Go Back   FlashFXP Forums > >

Programming Need help with C/C++/Delphi? Ask here and make us all laugh.

Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 10-26-2003, 10:33 AM   #1
b>d>>s
Senior Member
 
Join Date: Feb 2003
Posts: 488
Unhappy checking/queueing access to file in tcl ?

hi, i started using a sql .dll in itcl for queueing access to the stats log file in a zipscript, but this is slow and mechanical (and now i got a new bug with it :X).

is there some trick to checking the status of a file with another tcl instance of zipscript, ie.

zs_1 has.ioftpd.log 'open' (thus i would read this as 'locked').
zs_2 checks 'status' of .ioftpd.log, if opened by another script ('locked'), queue.
zs_1 'closed' ('unlocked') .ioftpd.log
zs_2 'opens' .ioftpd.log (thus 'locking' it somehow).

?

any help, thx.
b>d>>s is offline  
Old 10-26-2003, 12:16 PM   #2
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

If you want to lock "testfile", try and create a *new* "testfile.lock" in the same directory. Repeat (with ample sleep) until this succeeds. To unlock, simply remove the file. This method is supported by almost all configurations.

flock might be avail too
http://osr5doc.ca.caldera.com:457/cg.../man?flock+TCL
Mouton is offline  
Old 10-26-2003, 12:46 PM   #3
b>d>>s
Senior Member
 
Join Date: Feb 2003
Posts: 488
Default

ok, then to queue ? maybe, after ms ?script script script ...?

in a loop, ? say, ?

while {1} {
after 1000
set a [file exists "c:/blah.log"]
if {0 == $a} {
break
}
}

hmm, that should do it. what about thread safe stuff ?
b>d>>s is offline  
Closed Thread

Tags
.ioftpd.log, file, locked, zipscript, zs_1

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No Route to Host Don General Discussion 1 08-22-2004 10:07 PM


All times are GMT -5. The time now is 02:03 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)