chmod files on ISP's server

S

Sisyphus

Hi,

Is there a general way, using perl, to change the permissions of my cgi
scripts once I've uploaded them to my ISP's server ?

I'm using Net::FTP to upload them, but they're arriving without the
necessary 'execute' permissions - and I don't see a way of fixing that
with either Net::FTP or Net::Cmd.

My ISP's help pages tell me that the files need to be set with a 755
permission but they don't tell me how to achieve that. I spoke to a
member of the support staff, but he couldn't tell me anything useful -
maybe I need to speak to a different staff member :)

Anyway, if there's a perl way that might/should work I'd appreciate the
pointers. And if there's not (in which case my post is OT) ..... well
.... I'd still appreciate some pointers on how to proceed :)

I can see the permissions (via ftp) in the browser - I just haven't yet
found a way to alter them using perl or any other means. (Should it be
achievable via the web browser ?? I would prefer to be doing it with perl.)

Cheers,
Rob
 
B

Bob Walton

Sisyphus wrote:

....
Is there a general way, using perl, to change the permissions of my cgi
scripts once I've uploaded them to my ISP's server ?

I'm using Net::FTP to upload them, but they're arriving without the
necessary 'execute' permissions - and I don't see a way of fixing that
with either Net::FTP or Net::Cmd.

My ISP's help pages tell me that the files need to be set with a 755
permission but they don't tell me how to achieve that. I spoke to a
member of the support staff, but he couldn't tell me anything useful -
maybe I need to speak to a different staff member :)

Anyway, if there's a perl way that might/should work I'd appreciate the
pointers. And if there's not (in which case my post is OT) ..... well
... I'd still appreciate some pointers on how to proceed :)

I can see the permissions (via ftp) in the browser - I just haven't yet
found a way to alter them using perl or any other means. (Should it be
achievable via the web browser ?? I would prefer to be doing it with perl.) ....

Rob

Well, if you were at a typical ftp client (like Windoze's ftp, for
example) all logged in and in the correct directory, you could type:

quote site chmod 755 filename.pl

at the ftp> prompt to do that (assuming the remote web server is a
typical Unix-type system). So I suspect the Perlish way would be to use
the ->quot() method in Net::FTP. But I haven't tried it.

Good luck.
 
S

Sisyphus

Bob said:
Well, if you were at a typical ftp client (like Windoze's ftp, for
example) all logged in and in the correct directory, you could type:

quote site chmod 755 filename.pl

at the ftp> prompt to do that (assuming the remote web server is a
typical Unix-type system). So I suspect the Perlish way would be to use
the ->quot() method in Net::FTP. But I haven't tried it.

Good luck.

Yep - works nicely when I supply the command as 'site chmod 755
filename.pl' rather than simply 'chmod 755 filename.pl' as I had been
trying.

Of course the bloody script still won't run :))

I'll eventually sort it out, no doubt. Thanks for the assistance.

Cheers,
Rob
 
P

Philip

try using the quot() method to execute a chmod command. for example:
$ftp->quot("site", "chmod", $mode, $file)
 
M

Matthias Weckman

Sisyphus said:
Hi,

Is there a general way, using perl, to change the permissions of my cgi
scripts once I've uploaded them to my ISP's server ?

That depends on which ftp server your ISP uses. Changing permissions of
remote files is not part of the ftp protocol. However, the ftp protocol
does offer the possibility to execute certain remote commands, but the
implementation is server specific.
I'm using Net::FTP to upload them, but they're arriving without the
necessary 'execute' permissions - and I don't see a way of fixing that
with either Net::FTP or Net::Cmd.

The Net::FTP module offers support for this through the 'site' method:
try
$ftp->site( 'chmod 755 ' . $filename);

[snip]
I can see the permissions (via ftp) in the browser - I just haven't yet
found a way to alter them using perl or any other means. (Should it be
achievable via the web browser ?? I would prefer to be doing it with perl.)

I don't think web browsers offer this possibility. Have you considered
using an ftp client to access an ftp server?
Cheers,
Rob

HTH,
Matthias
 
S

Sisyphus

Matthias said:
The Net::FTP module offers support for this through the 'site' method:
try
$ftp->site( 'chmod 755 ' . $filename);

I can (now) see no reason that wouldn't work either.
I don't think web browsers offer this possibility. Have you considered
using an ftp client to access an ftp server?

Not really .... I've used CuteFTP in the past ... using perl would suit
my purposes so much better .... once I come to grips with what's going
on :)

Thanks Matthias.

Cheers,
Rob
 

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

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top