tommo_blade wrote:
....
> I have read thru the perl docs for this module and I have
> tried a few of the 'methods' available but as yet I have not been able
> to get my script to pull the data I need from the server. basically I
> want to know if there is enough 'available space' on a unix partition
> prior to me FTP'ing a file to that host/partition, I have tried the
> 'ls' and 'dir' methods but I cannot get what I need. The data I need at
> unix level can be gained by running a 'df -k' command which when run
> returns the available disk space in the 'avail' column.
>
> Does anyone know of any neat tricks to get this data.
Well, I don't know how "neat" it is, but you can use Net::FTP's quot()
method to execute a command on the remote system. I use it to chmod CGI
programs to executable on ISP systems that don't provide command line
access, for example (yeah, I know, I could get a better ISP). To get
the result of the command returned back to you, you will probably need
to redirect the STDOUT of the command to a file, then use the get()
method to get the file, then open and read it. I don't know if the
remote FTP server will run operating system commands with STDOUT
redirected -- you'll have to try it and see. You can check out how it
works with a command-line FTP client -- when you see you can do what you
want with a manual client, then implement it using Net::FTP.
You might be just as well off to do your put() and check the return for
an error.
HTH.
> cheers, Mark.
--
Bob Walton
Email:
http://bwalton.com/cgi-bin/emailbob.pl