mkdir

mkdirFILENAME,MASKmkdirFILENAME
This function creates the directory specified by
FILENAME, giving it permissions specified by
the numeric MASK as modified by the current
umask. If the operation succeeds, it
returns true; otherwise, it returns false.
If MASK is omitted, a mask of 0777 is assumed, which is almost always what
you want anyway. In general, creating directories with permissive
MASKs (like 0777) and letting the user modify that with
her umask is better than supplying a
restrictive MASK and giving the user no way
to be more permissive. The exception to this rule is when the file or
directory should be kept private (mail files, for instance). See
umask.
If the mkdir(2) syscall is not built into your C library, Perl emulates it by calling the mkdir(1) program for each directory. If you are creating a long list of directories on such a system, it’ll be more efficient to call the mkdir program yourself with the list of directories than to start zillions of subprocesses.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access