chmod files on ISP's server

Discussion in 'Perl Misc' started by Sisyphus, Oct 13, 2003.

  1. Sisyphus

    Sisyphus Guest

    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
    --
    To reply by email u have to take out the u in kalinaubears.
    Sisyphus, Oct 13, 2003
    #1
    1. Advertising

  2. Sisyphus

    Bob Walton Guest

    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.
    --
    Bob Walton
    Email: http://bwalton.com/cgi-bin/emailbob.pl
    Bob Walton, Oct 13, 2003
    #2
    1. Advertising

  3. Sisyphus

    Sisyphus Guest

    Bob Walton wrote:

    >
    >
    > 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


    --
    To reply by email u have to take out the u in kalinaubears.
    Sisyphus, Oct 13, 2003
    #3
  4. Sisyphus

    Philip Guest

    try using the quot() method to execute a chmod command. for example:
    $ftp->quot("site", "chmod", $mode, $file)
    Philip, Oct 13, 2003
    #4
  5. Sisyphus wrote:
    > 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
    Matthias Weckman, Oct 13, 2003
    #5
  6. Sisyphus

    Sisyphus Guest

    Matthias Weckman wrote:

    >
    > 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

    --
    To reply by email u have to take out the u in kalinaubears.
    Sisyphus, Oct 13, 2003
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Lubavin
    Replies:
    1
    Views:
    3,055
    Steve Grazzini
    Jul 25, 2003
  2. Brad Cooper

    Chmod from Runtime.Exec

    Brad Cooper, May 13, 2004, in forum: Java
    Replies:
    3
    Views:
    10,077
    Brad Cooper
    May 13, 2004
  3. Bob K.
    Replies:
    9
    Views:
    1,556
    PeterMcC
    Jul 5, 2004
  4. Fuzzyman

    Understanding CHMOD

    Fuzzyman, Feb 13, 2004, in forum: Python
    Replies:
    6
    Views:
    783
    Fuzzyman
    Feb 13, 2004
  5. keith
    Replies:
    1
    Views:
    372
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 26, 2007
Loading...

Share This Page