File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes get zero bytes file from ftp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "get zero bytes file from ftp" Watch "get zero bytes file from ftp" New topic

get zero bytes file from ftp

Rahul Chaudhari

Joined: Jul 30, 2008
Posts: 5
How to get zero bytes file from ftp.

How I can write ls command output to some file in ftp promte.
I tried using following,

ftp 10.x.x.45 << INPUT_ENDS
cd /home/dynamic/
ls *.csv > /home/dynamic/log/csvfile.txt

I have full rights to log folder then also I cannot write file and not the output.

Please can any one tell me how to achive it.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

That's because you're working with an FTP server, not a remote shell server. For convenience, FTP's command set is similar to the standard command set, but the FTP shell isn't a command shell and it doesn't have all the command shell features.

The way to create an empty file on an FTP server is to upload an empty file to the FTP server. If your ftp client and local command shell permits it, that could include uploading an empty "here" file, but it's still got to be a file, even if it's only a temporary one.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: get zero bytes file from ftp
It's not a secret anymore!