Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Cool How to read only files which have end of file using lftp from a folder?

    lftp is reading the files which are being created and want to avoid that. Is there is way I can config lftp to read only the files which have reached end of the file in a folder. My ftp source system generates several files and we have a batch shell script which pings the source for every 30 secs and reads the file using the newer than option, lftp reading the larger files which are being created in every 30 seconds even though the file is not fully populated by source.

    any help would be appriciated

    thx - bmk

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Unlike Windows, there is no "end-of-file" marker in Linux files. The design of the system allows reading/editing of partially written files. Sorry, but you are out of luck on this. You could change your script/application that creates the files to put the new ones in a temporary directory inaccessible by lftp and then move them into the accessible directory once they are finished being written to.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts