Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

chmod with Net::FTP

by Anonymous Monk
on Aug 01, 2001 at 18:00 UTC ( [id://101367]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi!

Has anyone ever tried to chmod a remote file with Net::FTP? Here is my code (does not work)

my $ftp = Net::FTP->new('foobar'); $ftp->login('foo', 'bar'); $ftp->put('localfile', 'remotefile'); $ftp->quot('chmod', '777', 'remotefile'); $ftp->quit();


Thoughts?

Thanks in advance!
Mr. D'Oh.

Replies are listed 'Best First'.
Re: chmod with Net::FTP
by cLive ;-) (Prior) on Aug 01, 2001 at 18:17 UTC
    Close. Next time you use a GUI FTP client, log your session, then look at exactly what gets sent.

    What you need is:

    $ftp->quot('SITE','chmod', '777', 'remotefile');

    Remember to send the full command when you use $ftp->quot!

    cLive ;-)

Re: chmod with Net::FTP
by nardo (Friar) on Aug 01, 2001 at 18:08 UTC
    $ftp->site('chmod', '777', 'remotefile');
Re: chmod with Net::FTP
by suaveant (Parson) on Aug 01, 2001 at 18:18 UTC
    Or... $FTP->quot('SITE',"CHMOD 777 remotefile");

    TIMTOWTDI

                    - Ant

Re: chmod with Net::FTP
by jlongino (Parson) on Aug 01, 2001 at 21:10 UTC
    Mr.D'Oh, Something to consider. In the rare event that the Net::FTP suggestions you've already received do not work, you might want to check with the Systems Administrator to determine whether or not they have disabled any of the standard inet services. I don't know which inet service(s) the Net::FTP module uses to implement the site() method.

    On all of our Unix boxes, services that rely on rexec, rsh, or rlogin have been disabled. After floundering around with the Net::FTP site() method for three days (the other Net::FTP methods worked fine), I discovered that command executions worked fine via the Net::Telnet cmd() method.

    Hope the Net::FTP site() solutions works for you.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://101367]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2024-04-24 23:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found