FTPLS command fetch filenames which are under creation

The FTP of some files take long time. During the creation of the file, the LS command retrieves the name of these partial files also. How can this be avoided or is there any indication that the file is partially created.


A best practice when FTP’ing files around is to use a naming scheme of some sort to indicate “file in progress.” We tend to use the convention of any file ending with “.tmp” is ignored for processing. So the steps for a file sender are:

  1. put the file with a name like “abc.tmp”
  2. rename the file from “abc.tmp” to “abc”

Then getters ignore any file ending in “.tmp”. This doesn’t prevent ls from returning the names of these partial files–you must explicitly ignore them.