FTP Question

Once a file is ftped to a server is there a way that you can prevent that file from being overwritten if the same process tries to ftp a file with the same name again?

ftp doesn't directly provide a way to stop that.
Some ftp versions support the "!" operator which allows remote execution of a shell command - which is not very secure.

Anyway, consider something like this.

[code]
!/bin/chmod 000 filename
[/codee]

thank you.

Many more ftp servers support the chmod command. If your client does not support
chmod 444 filename
you can still try the site command:
site chmod 444 filename

Jim, I have never seen that ! stuff on any ftp server. Where did you see it?

Some of the original versions of ftp come from Washington State University - and it supports the bang operator - it was undocumented.

I'm just showing my age. The site command is in fact much more common now.

Yeah that ! is really good stuff. I use it all the time. We are using HPUX 11.x. But on my system, ! exits you back to the shell on your local system, not the remote system. You can actually simply type "!" and it will toggle you out of the FTP session and back to the shell. When your finished doing what you need to do in the shell you can type exit and it will toggle you back to your open FTP session (assuming you didnt take so long that it caused the FTP session to time out)

Hi,

Yes, Google is absolutely Right.

The '!' allows you to have a (cofee-)break with the FTP and enter
in to shell from where you can return back (just for time being if you wish) with the exit command at the shell.

This takes you to shell while still ftp being running, and you can
return back by just typing exit at the console/shell prompt.
Since '!' takes you to the shell, and you can execute any shell
command as usual, you can do the same (execute any shell command)
with out completely coming out of FTP.

In simple, from the FTP application itself, you can execute any
valid shell command by just prefixing the command with a Bang ('!').

Ex:-

ftp> !ls -l
or
ftp> !who
or
ftp> !man ftp

etc.,

This way you can avoid un-necessarily going out and comming in
of FTP just for executing some command at shell.
And this is supported in all most all of the Unix Flavours.
And even Microsoft Windows also holds good with this concept.

Vishwa.