File: make_a_new_directory.pl

package info (click to toggle)
libfile-util-perl 4.201720-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 840 kB
  • sloc: perl: 4,353; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# ABSTRACT: Make a new directory, even if the parent directory doesn't exist

use strict;
use warnings;
use File::Util;

my $ftl = File::Util->new();

$ftl->make_dir( '/tmp/myapp_tempfiles' );

# optionally specify a creation bitmask to be used in directory creations.
# the bitmask is combined with the user's current umask for the creation
# mode of the file.  (You should usually omit this.)
$ftl->make_dir( '/tmp/a/b/c/foo/bar', oct 755 );

exit;