in reply to Re: Handling returns from mkdir.
in thread Handling returns from mkdir.

Perl has a mkdir function built in, there's no need to rely on an external command.

Replies are listed 'Best First'.
Re^3: Handling returns from mkdir.
by samarzone (Pilgrim) on Dec 24, 2010 at 09:32 UTC

    You are right. In the above answer I was just concerned with the way of output. I should have thought on the approach itself.

    Thanks marto.

    --
    Regards
    - Samar
Re^3: Handling returns from mkdir.
by dannyd (Sexton) on Dec 24, 2010 at 10:59 UTC

    Hi marto,

    Thats actually what I was looking for..managed to use the built in command instead.

    I have been trying to find other errors reported by $!(File exists being the only one that kept coming up with the code), without any luck.

    I know this sounds pretty silly but, can you please tell me how i can find them(maybe a list of some sort)....im still a newbie.

    Thanks for all the help so far!!

      On the system documented by this man page, mkdir can return the following:
      • EACCES
      • EEXIST
      • EFAULT
      • ELOOP
      • ENAMETOOLONG
      • ENOENT
      • ENOMEM
      • ENOSPC
      • ENOTDIR
      • EPERM
      • EROFS

      Those constants are provided by Errno and via %!. Don't rely on the stringification except for display purposes, because that depends on the system's locale.