in reply to Re: Untainting 'bad' filenames
in thread Untainting 'bad' filenames

elwarren brings up a good point about checking to see whether the file is still in the middle of being ftp'ed by another process. If you are on a unix (or Solaris, Linux, etc.) box, check out the fuser command. See your local manpage for more info on it.

Replies are listed 'Best First'.
Re: Re: Re: Untainting 'bad' filenames
by elwarren (Priest) on Dec 09, 2000 at 04:17 UTC
    Sometimes I get around this by writing out a second file after the first is completely written. Then the process polls the directory looking for filename.whatever.done When the .done file shows up I know it's safe to move the file I actually want.

    Reading some fresh posts it looks like you're grabbing files from a custom ftp server, so this really isn't a solution for your problem...