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 08-31-2003, 05:27 PM   #1
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default How to catch STOR filename errors ?

[23:57:54] STOR 08.rar
[23:57:54] 550 08.rar: No such file or directory.
[23:57:54] Transfer Failed!

How can I catch those ?
I have an event in [Pre] STOR, and I would need to undo what it has done if the STOR doesn't start. OnUploadError event isn't called :\

The [Pre] STOR event is used to prevent two users from overwriting each other if "SIZE filename" return 0 but the file was already started by someone else (dark said it's because of OS disk caching).

Any idea ?
Mouton is offline  
Old 09-01-2003, 05:14 AM   #2
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

?? undo what is has done??
Your [Pre] STOR could always try an fopen and if file doesnt exist do xxx else if file exists but is locked do YYY else some other error.
FTPServerTools is offline  
Old 09-01-2003, 09:12 AM   #3
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

That's what i can't do. The file isn't on disk yet. My Pre STOR event just logs the filename in .ioFTPD.xdupe and return 0 if it wasn't there already, and 1 if it was. That way, no one can overwrite someone else file.

The solution I found is to make the xdupe log expire after 5 secs. So nobody can overwrite any file that was "STOR filename" in the last 5 secs. That should fix the cached file overwrite problem, and allow failed STOR command to be restart after 5 secs.
Mouton is offline  
Old 09-02-2003, 02:40 AM   #4
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

?? it isnt on disk yet?? I would guess darkone uses a CreateFile thus it would appear immediately as a 0 byte locked file on your HD.
Probably I dont understand your question. See ya on irc.
FTPServerTools is offline  
Old 09-02-2003, 07:07 AM   #5
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

is not on disk yet as in STOR filename on one sessions starts, another session (set in ffxp to skip all) sends SIZE filename to know if the file exists at the same time, and gets File not found, so it do a STOR filename. 2 sessions are uploading the same file, overwriting each other.

You can reproduce by uploading a bunch of small files using 2 or more ffxp sessions, and reply skip all on overwrite prompt. You'll see what happens.
Mouton is offline  
Closed Thread

Tags
catch, event, file, stor, [235754]

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


All times are GMT -5. The time now is 08:42 PM.

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