1

I'm having trouble finding the answer to this question, maybe I'm just not asking the question properly. I have to put a file that is relatively large (~500MB at least) in an ftp server and then run a process that takes it in as a parameter. My question is as follows. If i'm using ftp.exe to do this, does the put command lock the process until the file is finished being copied?

I was planning on using a .bat file to execute the commands needed but I don't know if the file is going to be completely copied before the other process starts reading it.

edit: for clarity's sake, here is a sample of the .bat that I would be executing.

ftp -s:commands.txt ftpserver

and the contents of the commands.txt would be

user
password
put fileName newFileName
quote cmd_to_execute
quit
Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

2 Answers2

1

The Windows ftp.exe (as probably all similar scriptable clients) executes the commands one-by-one.

No parallel processing takes place.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
-1

FTP as a protocol doesn't specify placing a lock on the files before writing it. However this doesn't prevent anyone from implementing this feature as it is a great value add.

Some FileSystems NTFS) may provide locking mechanism to prevent concurrent access. See this File locking - Wikipedia

See this thread as a reference: How do filesystems handle concurrent read/write?

Kaushal Kumar Panday
  • 2,329
  • 13
  • 22
  • The thing is I'm not looking to lock the file itself, at least not with this current implementation. If you look at my edit on the OP you'll understand what I mean. What I need to know is whether the command after the put will not execute until the put is completed. – Salvador Abate Jun 26 '17 at 13:59
  • OK. The read command after the put should execute. Take this for example: if you try to upload a large text file and then immediately open this in a browser, then this will work and you will see a truncated version of the file. At the end of the day you need to know that the FTP.exe doesn't provide any file-handling capabilities. It relies on the underlying File System for that. Do note that, it also depends on the client that is reading the file. – Kaushal Kumar Panday Jun 26 '17 at 14:17