directorys

Discussion in 'Perl Misc' started by Robin, Jan 6, 2004.

  1. Robin

    Robin Guest

    How would I set chmod on a directory without making one and without using
    exec or system...and how would I and what is a SUID bit for mkdir ("test",
    0755)
    is in the first number?

    -Robin
     
    Robin, Jan 6, 2004
    #1
    1. Advertising

  2. Robin

    Simon Taylor Guest

    Robin wrote:
    > How would I set chmod on a directory without making one and without using
    > exec or system...and how would I and what is a SUID bit for mkdir ("test",
    > 0755)
    > is in the first number?
    >
    > -Robin


    The general solution is to use the chmod() function, see:

    perldoc -f chmod

    Here's a sample:

    chmod 0600, $dir;

    I'm sorry but I don't understand the second part of your question.

    Regards,

    Simon Taylor
     
    Simon Taylor, Jan 6, 2004
    #2
    1. Advertising

  3. Robin wrote:
    > How would I set chmod on a directory without making one and without
    > using exec or system...


    You would do as the documentation for the chmod() function suggests.

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Jan 6, 2004
    #3
  4. Robin <> wrote:

    > How would I set chmod on a directory without making one and without using
    > exec or system...



    perldoc -f chmod


    Is it possible that you didn't even look for a like-named function?


    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Jan 6, 2004
    #4
  5. Robin

    Robin Guest

    the book I have said it works for files, and I was assuming it didn't work
    for directories...

    thanks a lot, appreciate it,

    -Robin

    "Robin" <> wrote in message
    news:btdkrv$qeg$...
    > How would I set chmod on a directory without making one and without using
    > exec or system...and how would I and what is a SUID bit for mkdir ("test",
    > 0755)
    > is in the first number?
    >
    > -Robin
    >
    >
     
    Robin, Jan 9, 2004
    #5
  6. Robin

    Robin Guest

    another thing, is it just
    $nameofdir = "somedirectory/"
    -e "$nameofdir"

    (not that this code runs)
    or likewise filetest operator to test on a directory?

    Thanks,
    -Robin

    "Robin" <> wrote in message
    news:btdkrv$qeg$...
    > How would I set chmod on a directory without making one and without using
    > exec or system...and how would I and what is a SUID bit for mkdir ("test",
    > 0755)
    > is in the first number?
    >
    > -Robin
    >
    >
     
    Robin, Jan 9, 2004
    #6
  7. Robin

    Ben Morrow Guest

    "Robin" <> wrote:
    > another thing, is it just
    > $nameofdir = "somedirectory/"
    > -e "$nameofdir"
    >
    > (not that this code runs)
    > or likewise filetest operator to test on a directory?


    A directory *is* a file. Anything that works on a file works on a
    directory (with the exception of opening it for writing).

    Ben

    --
    Although few may originate a policy, we are all able to judge it.
    - Pericles of Athens, c.430 B.C.
     
    Ben Morrow, Jan 9, 2004
    #7
  8. Robin <> wrote:

    > another thing, is it just
    > $nameofdir = "somedirectory/"
    > -e "$nameofdir"



    No, it is: -e $nameofdir


    perldoc -q vars

    What's wrong with always quoting "$vars"?



    [snip TOFU. Please learn the proper way of quoting followups]

    --
    Tad McClellan SGML consulting
    Perl programming
    Fort Worth, Texas
     
    Tad McClellan, Jan 9, 2004
    #8
    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. Thomas Brendgen

    Accessing Directorys

    Thomas Brendgen, Feb 26, 2005, in forum: C++
    Replies:
    4
    Views:
    361
    Rolf Magnus
    Feb 27, 2005
  2. Harry Nash
    Replies:
    1
    Views:
    125
    David Mullet
    Jan 18, 2009
Loading...

Share This Page