From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to find disk space on a FTP server

I could find the disk space on a PC connected on the LAN. But I need to know how to find disk volume of a FTP site.
Thanks .
0 Kudos
Message 1 of 4
(16,836 Views)
I suspect you might have a hard time with this in the general case. I don't think an FTP server is required to expose any method of determining disk space or quota information. That sort of thing is really more in the domain of a true shell interface to the server (e.g. telnet), where you can use commands like df.

That said, you can find out what extra, non-required commands are supported for specific FTP servers by establishing a command-line FTP session and issuing the command "quote site help". This should list the available commands, and if you're lucky, you will see "df" among them. If it is, then you can issue "quote site df" to get a reply that contains the disk space information you're after. NI's FTP site actually exposes df and a bunch of other stuff, so you can test things out there.

There are no LabVIEW primitives for doing this programmatically, so it's going to be much more overhead than what you're used to with the PCs on your LAN. I put together a quick example (LV 7.1) that uses the Internet Toolkit VIs to open up an FTP session with an arbitrary server, send a "SITE DF" command, and return the reply string. If you don't have that toolkit, you might consider getting it; otherwise, you could try to develop something similar with the OpenG Internet Connectivity Tools.

At the end of the day, this still won't be a reliable way to get volume info from an arbitrary FTP server, so maybe other people have some ideas for you.

Regards,
John
0 Kudos
Message 2 of 4
(16,821 Views)
Hi John,

Thanks for the info. I think the FTP server where i am trying to store my files does not support "site DF" option.
So now what I'll do is instead of checking for free space and then placing the file, I will try to store the file on to FTP server first , if there is enough space on the FTP disk then fine but if there is not then I will get an error.THen I can handle the error and inform the user that there's no space . AS i cannot test it as of now, I wanted to know what will be the FTP error code for this ( not enough disk space on FTP). so that I can program it and keep.

Thanks, Hema
0 Kudos
Message 3 of 4
(16,805 Views)
Hema,

The FTP RFC document suggests to me that you'll get the following reply code if you run out of space during a transfer:

452 Requested action not taken.
Insufficient storage space in system.

Regards,
John
0 Kudos
Message 4 of 4
(16,800 Views)