|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Ftp and batch file question
im gonna be writing a script that will seach a folder for a certain file extension and FTP these particular files to an AS/400 server automatically (ie an in house service will be running that runs this script every few minutes). these files are being created by another small console app. i only want to send the files when they are complete, and since this process of createing them is pretty damn quick i dont think there will be a problem... but there is always the chance that the ftp script will try to send the file at a moment when the file will be open and being created. so if anyone can answer this, will the ftp fail if a file is open and being written too at that moment that it tries to send it(which would be great, because then the script could pick it up on the next pass) or will it send a partial file (which is not great)?
|
|
#2
|
||||
|
||||
|
no, it will not fail.
You should try copying it to another directory and then mv'ing it. you're guaranteed to be sorted via mv, since all it does it reroute an inode, and therefore doesn't actually move the file at all.
__________________
~James [Not currently seeking freelance work] Like philosophy or interested in spirituality? Philosophorum. Game Dev Experts Forums Foresight Linux - Because your desktop should be cool! Linux FAQ FedoraFAQ UbuntuGuide |
|
#3
|
|||
|
|||
|
Failure is a function of the operating system. LinuxPenguin is correct in that it won't fail on a linux/unix OS. On a Windows OS, then it depends upon the flags given then the file is create/opened by the creating process.
I agree about the moving of the file. This will work for for both OSs. |
|
#4
|
|||
|
|||
|
just to follow up, yea i went with moving the file first to a temp FTP directory and from there a little mfc app will push the files to the server. thanks for the info.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Ftp and batch file question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|