How does FTP servers handle concurrent access to the same file, i.e. if one user is updating a file while another is reading the same file? Should I be worried about getting corrupt data? Is it dependent on the FTP server or even the operating system?
|
I think the FTP Server itself does not handle this. If a read starts before a write, the read would typically get the older version. You should get the answer to this question based on |
|||
|
|
|
I think FTP implementations just don't deal with this, and the OS will vary on how it does, windows might lock the file, linux will give you partial data. Yes you should be worried, specially under high usage. The solutions I found on the past were sketchy at best, including different folders for upload/download and a monitor process to copy from upload to download when the file is fully uploaded. This gets worse as files are longer and/or people upload from slow connections. |
|||
|
|
|
I am pretty sure you could have problems. Try this: Start a upload of a large file to your FTP server. Refresh the view of the folder it is being uploaded to and you will see that the file size increases and the upload progresses. If you try this with a .mp3 file. You can access it via the browser and see that it will only play up to the point that is has currently been uploaded. This is why programs like Dreamweaver have a check in/check out system. So that if someone is working on a .html file someone else cannot upload a older version or cause that sort of problems. I don't think FTP uses any kind of temp files or queuing either... |
|||||||
|
|
Whenever I attempt to access a page I haven't uploaded yet, I get a "connection reset while loading". I think it's really up to the software, though. |
|||
|
|
|
Using a Revision Control Software would help in this case, have a look at Git and SVN, note that there is two main types (centralized and distributed) and many other applications in addition to those two. |
|||||||
|