FTP GET command in winXP works differently than in win2k

G

Guest

Here's the issue: The FTP GET command works differently in winXP than it does
in win2k. When you try to get a file in the remote location, and the file
doesn't exist then win2k will just give a error message stating that the
system cannot find the file specified. This is the problem; if you do the
same thing in winXP then along with the error message stating system cannot
find the file, it also creates an empty file in the name of the file you were
attempting to get. This completely ruins any attempt to verify if the file
really existed or not, especially when using VBS scripts. My company uses a
lot scripts with ftp, and we would like to upgrade to XP on the pc that runs
the scripts, but we are at hold still because of this issue. Does anyone
have a good soluation for this problem? All I want is for ftp to work the
same way on winXP as it does on win2k. Please help, I'm out of ideas here.
 
P

Pegasus \(MVP\)

NateAdmin1 said:
Here's the issue: The FTP GET command works differently in winXP than it does
in win2k. When you try to get a file in the remote location, and the file
doesn't exist then win2k will just give a error message stating that the
system cannot find the file specified. This is the problem; if you do the
same thing in winXP then along with the error message stating system cannot
find the file, it also creates an empty file in the name of the file you were
attempting to get. This completely ruins any attempt to verify if the file
really existed or not, especially when using VBS scripts. My company uses a
lot scripts with ftp, and we would like to upgrade to XP on the pc that runs
the scripts, but we are at hold still because of this issue. Does anyone
have a good soluation for this problem? All I want is for ftp to work the
same way on winXP as it does on win2k. Please help, I'm out of ideas here.
--
Nathan
Network Administrator
MCP in Managing and Maintaining a MS Win Server 2003 Enviroment
CCNA

Seems to be simple: Get your script to check if the resulting file
is empty,
 
G

Gordon

NateAdmin1 said:
Here's the issue: The FTP GET command works differently in winXP than
it does in win2k. When you try to get a file in the remote location,
and the file doesn't exist then win2k will just give a error message
stating that the system cannot find the file specified. This is the
problem; if you do the same thing in winXP then along with the error
message stating system cannot find the file, it also creates an
empty file in the name of the file you were attempting to get. This
completely ruins any attempt to verify if the file really existed or
not, especially when using VBS scripts. My company uses a lot
scripts with ftp, and we would like to upgrade to XP on the pc that
runs the scripts, but we are at hold still because of this issue.
Does anyone have a good soluation for this problem? All I want is
for ftp to work the same way on winXP as it does on win2k. Please
help, I'm out of ideas here.

Two options come to mind:
1. Use mget rather than get.
2. Use an ftp replacement called MoveitFreely (ftps.exe). Ftps also allows
passive ftp.
 
G

Guest

Thought of that already. We having scripts that are run daily, and there is
a possiblity that our vendors place empty files for us to ftp just to verify
they placed a file in there ftp site. If we looked at size alone we than on
those days it appear that there was no files sent. If a real problem
happened and there really wasn't a file placed at the remote site we would
have no way to know, and that is a head ache we can't afford. That was my
first idea too.
 
G

Guest

Funny you should say that because I that mget was the soluation to my
problems too. The only problem is that with mget you cannot direct the file
to go to a desired directory, only the default directory. With the hundards
of ftp tranfers we do it would be a unrealistic to put all the files in one
folder, not to mention since the default is C:\ it would slow down our pc in
no time. I'll look into MoveitFreely. I figured I'd have to eventually use
a outside application unless microsoft fixed the ftp get problem themselves.
Thanks for help.
 
J

jameshanley39

Thought of that already. We having scripts that are run daily, and there is
a possiblity that our vendors place empty files for us to ftp just to verify
they placed a file in there ftp site. If we looked at size alone we than on
those days it appear that there was no files sent.

how about checking the file's "time stamp" ? i.e. if it it's empty and
it was modified or created the moment the command to retreive the
remote file was issued, then you know it got there from that.

or. You could note that there is an empty file, see the filename.
Delete it, retreive the remote file again.
If it created an empty file then you know the remote file didn't
exist.

Though all those methods fail if the remote file is empty.

But how about this..

How about amending all the local empty files, so they are not empty.
Put some code in there like -999.
Then Retreive all the remote files.
(You will change the local files back to empty again at a later
step.. )
Check all your local files. If any are empty then you know the remote
file didn't exist.
Now you've made a note of those that don't exist.
Change all your local files that are -999 to empty again.

Looks like a programming thinking kind of issue really


<snip>
 
G

Guest

That would probably work, and you could do it in a script. The only downfall
is that we have hundards of scripts we use for automating ftp, and it sounds
like your approach can turn into quite a project (and that would be a one man
project, namely me). If all else fails though, I may have to use your
approach. Thanks for the help.
 
G

Guest

Gordon,

Thanks for the advice of using MoveitFreely. Since it works the same as
win2k ftp I didn't have to change anything in my scripts except for 'ftp' to
'ftps'. Works great, and is a little quicker as well. Thanks again.
 
J

jameshanley39

That would probably work, and you could do it in a script. The only downfall
is that we have hundards of scripts we use for automating ftp, and it sounds
like your approach can turn into quite a project (and that would be a one man
project, namely me). If all else fails though, I may have to use your
approach. Thanks for the help.

--
Nathan
Network Administrator
MCP in Managing and Maintaining a MS Win Server 2003 Enviroment
CCNA


How about using a different FTP client?

Have you tried putting the Win2k FTP client (ftp.exe I suppose) on Win
XP ?

or using any similar ftp client, which doesn't have this odd
behaviour, and if necessary, make any minor syntax amendments to your
scripts.

also, it's better not to "top post".
<snip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top