View previous topic :: View next topic
|
Author |
Message |
Vishwamurthy
New User
Joined: 11 Mar 2008 Posts: 57 Location: India
|
|
|
|
Hi,
Is there any way we can issue an FTP PUT command so that this command fails when the file is already present on the server and not replaces it?
I can't do a DIR/GET for the file because the server seems to be meant only for PUTs, and fails evertime when we issue a DIR/GET with a 451 File not found error even though there's no file on server, which is wierdly sad.
The only way out is to use a variant of PUT so that it ensures it fails if the file's already there and places the file if there's no file..
Note. The file has a particular naming convention, and I can't use DATE or Timestamp to workaround |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
Quote: |
Is there any way we can issue an FTP PUT command so that this command fails when the file is already present on the server and not replaces it? |
'FTP PUT' will replace the destination file blindly. I think this cannot be changed.
FTP GET has a REPLACE option but im afraid it won't be of any use to you in this scenario. |
|
Back to top |
|
|
bodatrinadh
Active User
Joined: 05 Jan 2007 Posts: 101 Location: chennai (India)
|
|
|
|
Hi Vishwamurthy,
Manually login to the server and rename the existing file. Then run your FTP job.
Thanks
-3nadh |
|
Back to top |
|
|
Vishwamurthy
New User
Joined: 11 Mar 2008 Posts: 57 Location: India
|
|
|
|
i think what you mentioned should help, although there's a requirement which says if the older file is present, it means that the previous instance of the process din' run. So if that will run, it should pick the renamed file and not the current file, which i'm afraid cannot happen.. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
RFC 959 indicates the STOR command, which is the official name for the PUT command, replaces an existing file. Unless your implementation of FTP is not standard, there is no way to change this behavior -- if the file does not exist, it is created; if the file does exist, it is replaced. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you work with the network and/or server sujpport people and find out Why you cannot issue the DIR command. . . |
|
Back to top |
|
|
Vishwamurthy
New User
Joined: 11 Mar 2008 Posts: 57 Location: India
|
|
|
|
We're thinking of this:
File01 for the first run
File02 for the second and so on..
This should help them pick the right file for the right process based on the number at the end..
Thanks guys, this can be closed now.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If someone has to "pick", sometmes they will pick incorrectly. . .
Why is the missing run not an issue?
Someone still needs to determine why the DIR cannot be done.
The issue can be "closed" (i.e. if no one else replies, it is closed ), but there are still issues that need to be resolved.
If this approach (getting around problems rather than addressing them) has been used every time something is amiss, the entire environment is probably a 'time bomb" that may completely destroy itself. |
|
Back to top |
|
|
|