Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#475 ftpGET returns 0 when out of space

v4.1
closed
Mark Miesfeld
Classes (182)
5
2012-08-14
2007-12-12
Ian Worthington
No

FtpGET continues even when the target disk is full, after which it returns OK even though the transfer has failed.

Discussion

  • David Ashley
    David Ashley
    2007-12-12

    Logged In: YES
    user_id=931756
    Originator: NO

    I am not sure anything can be done about this. The problem is that the FTP server does not return an error when the local disk is full. And the actual file transfer is handled by a thread in RxFTP. And I think (but I am not 100% sure) that the standard FTP command line interface returns the same value when a disk fills up. So I am not sure I want RxFTP to behave differently that the command line version.

    If you have information or an example of a different behavior for some other version of FTP please post it here.

     
  • Logged In: YES
    user_id=1415434
    Originator: YES

    Standard MS ftp response is "No space left on device", immediately that condition is detected, viz:

    Directory of U:\tv2

               2 Dir(s)     151,695,360 bytes free
    

    U:\tv2>ftp 192.168.1.70
    ...
    ftp> get Coast.rec
    200 PORT command sucessful.
    150 Opening ASCII mode data connection for 'Coast.rec' (815288320 bytes).

    Coast.rec:No space left on device
    550 Coast.rec
    ftp: 151654792 bytes received in 144.31Seconds 1050.92Kbytes/sec.

     
  • Logged In: YES
    user_id=1415434
    Originator: YES

    Clarification: retc from ftpget is 0 (not OK) on this error.

     
  • David Ashley
    David Ashley
    2007-12-12

    Logged In: YES
    user_id=931756
    Originator: NO

    I have commited a potential fix for this problem. I am not sure it is 100% correct so would you please try it out? It is a part of rev 1518 in interpreter-3.x/trunk/rexutils.

     
  • Logged In: YES
    user_id=1415434
    Originator: YES

    Initial testing looks good:

    Get of Christine_071206.rec to d:\tv2\Christine_071206.rec.ftp failed, retc = -1 FtpErrNo = FTPCOMMAND

    Any reason why all errors have to return an ErrNo of "FTPCOMMAND"? Could we use that string for, for example, "Write to disk failed, drive may be full", or something more helpful for an end user?

     
  • David Ashley
    David Ashley
    2007-12-12

    Logged In: YES
    user_id=931756
    Originator: NO

    In most cases the array in self~cmdresponse has the full response from the command. The error message you are looking for is probabley in self~cmdresponse[last]. This is just a mimic of the old rxftp.dll hehavior. If you need/want something added feel free to create a feature request and we will see what can be done. For now I am going to mark this bug as closed.

     
  • Logged In: YES
    user_id=1415434
    Originator: YES

    Spoke too soon. It returns that error even on a sucessful tx:

    TYPE I
    PASV
    RETR to delete.rec
    Get of to delete.rec to d:\tv2\to delete~1.rec.ftp failed, retc = -1 FtpErrNo =
    FTPCOMMAND
    Size = 0 LocalSize = 0
    cmdresponse: 226 Transfer complete.

    FtpErrNo = FTPCOMMAND

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-08-12

    Committed revision 6100.

    This bug is fixed in trunk. FtpGet quits with an error if the disk is full. FtpGet indicates no error when the file is received okay.

    F:\test>basicGet.rex
    No file to get specified on the command line. Using: bigFile.zip
    Replies will be written to log file: logfile.txt.
    USER miesfeld
    PASS XXXX
    SYST
    Connection established.
    TYPE I
    CWD tempFile
    PASV
    RETR bigFile.zip
    File was NOT received.
    FtpErrNo = FTPCOMMAND
    Last command response:
    426 Failure writing network stream.
    QUIT

    F:\test>dir
    Volume in drive F has no label.
    Volume Serial Number is F84F-BB22

    Directory of F:\test

    08/11/2010 02:54 PM <DIR> .
    08/11/2010 02:54 PM <DIR> ..
    08/12/2010 06:50 AM <DIR> filler
    08/12/2010 08:59 AM 1,639 basicGet.rex
    08/12/2010 09:07 AM 14,090,240 bigFile.zip
    08/12/2010 09:07 AM 0 logfile.txt
    3 File(s) 14,091,879 bytes
    3 Dir(s) 0 bytes free

    F:\test>
    F:\test>del bigFile.zip

    F:\test>basicGet.rex smallFile.zip
    Replies will be written to log file: logfile.txt.
    USER miesfeld
    PASS XXXX
    SYST
    Connection established.
    TYPE I
    CWD tempFile
    PASV
    RETR smallFile.zip
    File received okay.
    FtpErrNo =
    QUIT

    F:\test>dir
    Volume in drive F has no label.
    Volume Serial Number is F84F-BB22

    Directory of F:\test

    08/11/2010 02:54 PM <DIR> .
    08/11/2010 02:54 PM <DIR> ..
    08/12/2010 06:50 AM <DIR> filler
    08/12/2010 08:59 AM 1,639 basicGet.rex
    08/12/2010 09:08 AM 426 logfile.txt
    08/12/2010 09:08 AM 121,590 smallFile.zip
    3 File(s) 123,655 bytes
    3 Dir(s) 13,926,400 bytes free

    F:\test>

     


Anonymous


Cancel   Add attachments