RE: Telnet friendly App

new topic     » goto parent     » topic index » view thread      » older message » newer message

Hey Nicky,

One great thing about Euphoria, is that you can delete Files to.  And if 
your worried about Multiple users accessing the same file, you can 
allways use the date() function, and create a File Name out of it.  
Example
sequence file, Entry
Entry = date()
file = sprintf("%0.2d-%0.2d-%0.2d--%0.2d-%0.2d-%0.2d.dat",
                {Entry[2],Entry[3],Entry[1]+1900,
                 Entry[4],Entry[5],Entry[6]}

Which, if they accessed it at 01/14/03, at 1:29:35 PM, the File name
would come up to be like:
01-14-2003--13-29-35.dat

Then you can just do a system("del " & file & " > NUL",2)
And if you want to see if the file exists, you can allways do
function exist()
    integer fh
    fh = open(file,"rb")
    if fh = -1 then
        return 0
    else
        close(fh)
        return 1
    end if
end function

Which returns True if the file exists, or False if it doesn't.  If it 
does, simply run the previous code above for making a filename.  It 
shouldn't take more then a second for Euphoria for Win32 to acomplish 
it's task, but you also must give time for extensive database searching, 
if you use SQL.  Other then that, recursive name changes, according to 
time, and date, will run pretty fast, and give less room for two 
instances of your program to write to the same file.  To figure out how 
long it would actually take for a EXW, and SQL to act, and complete, you 
can call time() before you call the system_exec(), and assign the value 
to a Atom, then call time() afterwards, and have Euphoria calculate the 
Runtime from when it was called, to when it was finished.

Just some tips to help ya out. blink

--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at
)--|--( at )^.^( at )--|--( at )^.^(@)--

EuMario
Mario Steele
Euphoria Instant Messenger (Soon to Come!)
http://groups.yahoo.com/group/euim/

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu