Local/remote access synchronization for an ftp site -


i writing code update application fetching new dlls ftp site, according manifest file, @ ftp site, specifies versions of each dll. basic idea is, updater program runs @ startup, checks manifest @ ftp site, downloads dll's newer used application, , starts application , shuts down.

this leads following problem, not sure of best way handle: want put new dll on ftp site, @ same time updater application instance tries read dll. if delete dll, , copy on new one, updater might not see file, though manifest says should there.

i have idea of sort of marker file, act synchronization object, , existence , updater instance can use lock, not moving problem? there still time between checking if lock there, , making lock, in else make lock, , start modifying ftp files. plus, if updater crashes before deleting marker, there no way of telling, whether leftover marker should deleted.

edit: saw suggestion upload files folder, , rename folder, since renames supposed atomic operation in ftp, possible rename folder name of existing folder? shouldn't existing folder deleted first, causing same problem?

is there standard approach solve this?

how this: on ftp server, include version info in filename. on client, rename file after downloading.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -