how to skip locked files?

Core FTP client questions and answers
Post Reply
chris27ftp
Posts: 3
Joined: Tue Jan 15, 2019 5:00 pm

how to skip locked files?

Post by chris27ftp »

Im using coreftp in a command line of a script, which is set to run every 15 minutes as part of a scheduled task.
How can I make sure that coreftp will not ftp a file which is only half written to the source folder?
I what it to just skip the file and then move the file the next time it runs.
ForumAdmin
Site Admin
Posts: 1001
Joined: Mon Mar 24, 2003 4:37 am

Re: how to skip locked files?

Post by ForumAdmin »

It may be the program writing out the file that is the issue. If the file is not locked exclusively other processes (Core FTP in this case) can open and read it.

If the file is being *copied* into the directory, Core FTP should not be able to open it during that time.

You may need to change your process so the file is not copied to the directory for uploading until writing to it is complete.
ForumAdmin
Site Admin
Posts: 1001
Joined: Mon Mar 24, 2003 4:37 am

Re: how to skip locked files?

Post by ForumAdmin »

Thinking about this a little more - an option could be added to Core FTP to open the file exclusively itself, which may solve the issue. Will look into this more and update this thread if it feasible.
chris27ftp
Posts: 3
Joined: Tue Jan 15, 2019 5:00 pm

Re: how to skip locked files?

Post by chris27ftp »

tested the file being copied and as you said to errors - so that's good

so my only problem will be with files that data is appended too - it would be great to have a option to exclusively lock the file before copying in the future

thanks
Post Reply