New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mkdir documentation: MASK -> MODE? #16278
Comments
From @eserteThis is a bug report for perl from slaven@rezic.de, perlfunc.pod names the second argument of mkdir() "MASK". I think Note also that "man 2 mkdir" also names the second argument "mode" Flags: This perlbug was built using Perl 5.20.2 - Mon Sep 18 18:13:32 UTC 2017 Site configuration information for perl 5.26.1: Configured by eserte at Sat Sep 23 09:36:11 CEST 2017. Summary of my perl5 (revision 5 version 26 subversion 1) configuration: @INC for perl 5.26.1: Environment for perl 5.26.1: |
From @TuxOn Sat, 25 Nov 2017 06:35:42 -0800, "slaven@rezic.de (via RT)"
Agree
HP-UX SYNOPSIS AIX Syntax mkdir [ -m Mode ] [ -p ] Directory ... -- |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Sat, 25 Nov 2017 06:35:41 -0800, slaven@rezic.de wrote:
The second argument *is* a bitmask, and MASK is more specific than MODE. Don’t forget "rwxr-xr-x" is a mode, but not one that mkdir will support. -- Father Chrysostomos |
From @jhi
Sorry, but this is not true. http://pubs.opengroup.org/onlinepubs/9699919799/functions/mkdir.html It is the mode (positive bits), not a mask (negative bits). It is *modified* by the process umask. The reference to "rwxr-xr-x" is somewhat irrelevant, since that is for the command line utilities, http://pubs.opengroup.org/onlinepubs/9699919799/utilities/mkdir.html |
From @cpansproutOn Sun, 26 Nov 2017 02:33:56 -0800, jhi wrote:
Thank you for the clarification. -- Father Chrysostomos |
From @mfontaniThe attached patch should resolve this |
From @mfontani0001-second-arg-to-mkdir-is-MODE-not-MASK.patchFrom 03ef34ccdc68742ab2024e720042b32b5b6a1872 Mon Sep 17 00:00:00 2001
From: Marco Fontani <MFONTANI@cpan.org>
Date: Tue, 28 Nov 2017 13:43:36 +0100
Subject: [PATCH] second arg to mkdir is MODE, not MASK
RT# 132505
---
pod/perlfunc.pod | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git pod/perlfunc.pod pod/perlfunc.pod
index ee8ec3d9f2..6b96f99e04 100644
--- pod/perlfunc.pod
+++ pod/perlfunc.pod
@@ -241,7 +241,7 @@ L<C<chroot>|/chroot FILENAME>,
L<C<fcntl>|/fcntl FILEHANDLE,FUNCTION,SCALAR>, L<C<glob>|/glob EXPR>,
L<C<ioctl>|/ioctl FILEHANDLE,FUNCTION,SCALAR>,
L<C<link>|/link OLDFILE,NEWFILE>, L<C<lstat>|/lstat FILEHANDLE>,
-L<C<mkdir>|/mkdir FILENAME,MASK>, L<C<open>|/open FILEHANDLE,EXPR>,
+L<C<mkdir>|/mkdir FILENAME,MODE>, L<C<open>|/open FILEHANDLE,EXPR>,
L<C<opendir>|/opendir DIRHANDLE,EXPR>, L<C<readlink>|/readlink EXPR>,
L<C<rename>|/rename OLDNAME,NEWNAME>, L<C<rmdir>|/rmdir FILENAME>,
L<C<select>|/select FILEHANDLE>, L<C<stat>|/stat FILEHANDLE>,
@@ -4148,7 +4148,7 @@ or to force an anon hash constructor use C<+{>:
to get a list of anonymous hashes each with only one entry apiece.
-=item mkdir FILENAME,MASK
+=item mkdir FILENAME,MODE
X<mkdir> X<md> X<directory, create>
=item mkdir FILENAME
@@ -4158,19 +4158,19 @@ X<mkdir> X<md> X<directory, create>
=for Pod::Functions create a directory
Creates the directory specified by FILENAME, with permissions
-specified by MASK (as modified by L<C<umask>|/umask EXPR>). If it
+specified by MODE (as modified by L<C<umask>|/umask EXPR>). If it
succeeds it returns true; otherwise it returns false and sets
L<C<$!>|perlvar/$!> (errno).
-MASK defaults to 0777 if omitted, and FILENAME defaults
+MODE defaults to 0777 if omitted, and FILENAME defaults
to L<C<$_>|perlvar/$_> if omitted.
-In general, it is better to create directories with a permissive MASK
+In general, it is better to create directories with a permissive MODE
and let the user modify that with their L<C<umask>|/umask EXPR> than it
is to supply
-a restrictive MASK and give the user no way to be more permissive.
+a restrictive MODE and give the user no way to be more permissive.
The exceptions to this rule are when the file or directory should be
kept private (mail files, for instance). The documentation for
-L<C<umask>|/umask EXPR> discusses the choice of MASK in more detail.
+L<C<umask>|/umask EXPR> discusses the choice of MODE in more detail.
Note that according to the POSIX 1003.1-1996 the FILENAME may have any
number of trailing slashes. Some operating and filesystems do not get
--
2.15.0
|
From @eserteDana Tue, 28 Nov 2017 04:51:53 -0800, mfontani reče:
Looks fine to me. |
@arc - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#132505 (status was 'resolved')
Searchable as RT132505$
The text was updated successfully, but these errors were encountered: