[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ftp_get local file created even if no file received



   I noticed that ftp_get will leave a zero byte local file in the IFS
   when no file is received from the ftp server. Since I'm replacing the
   IBM FTP client with FTPAPI, and the IBM client does not exhibit the
   same behavior, I'd prefer to modify FTPAPI so it does not leave these
   zero byte files out there.
   I tweaked ftp_get as below, which works fine for files in the IFS. If
   the output is directed to a physical file, it removes the member but
   does not delete the file. There may be more to this than I thought.
   Ideally, if the local file was not there to start with, I'd want it
   deleted if there was no file to get. If the local file did exist, I
   think I'd want it left as it was.
   Thoughts anyone?
   2205.00  * download into the
   file...
   2206.00 c                   eval      wwRC = FTP_getraw(peSocket:
   peRemote:
   2207.00 c                                     wwFD:
   p_write)
   2208.00 c                   if        wwRC <
   0
   2209.00 c                   callp
   CloseMe(wwFD)
   2210.00 c                   callp
   unlink(%trim(wwLocal))
   2211.00 c                   return
   -1
   2212.00 c
   endif

   --


   Chris Edmondson

   [1]chris@xxxxxxxxxxx

   509.670.6817

References

   1. mailto:chris@xxxxxxxxxxx
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------