From: Kent Dahl Date: 2003-01-15T16:58:06+09:00 Subject: Re: Dir.mkdir TOTO wrote: > > I am quite confused by the "Dir.mkdir( aString [, anInteger ] ) -> 0" > class method. It doesn't seem to work as expected in the UNIX way. > > Say I have the following program, mkdir.rb: > > #! /usr/bin/env ruby > Dir.mkdir(ARGV[0], 0777) if ARGV.size >= 1 > > When I type: > > mkdir.rb t > > instead of set the permission of the directory t to: drwxrwxrwx, it is > set to: drwxr-xr-x Could it be this? http://www.rubycentral.com/book/ref_c_dir.html#Dir.mkdir " The permissions may be modified by the value of File.umask " [kentda@v052a tmp]$ ruby -e 'printf "%o\n", File.umask; Dir.mkdir "t", 0777' 22 [kentda@v052a tmp]$ ls -al t totalt 12 drwxr-xr-x 2 kentda kentda 4096 jan 15 08:53 ./ drwx------ 23 kentda kentda 8192 jan 15 08:53 ../ 22 would mask the write bits, so it looks right. -- (\[ Kent Dahl ]/)_ _~_ __[ http://www.stud.ntnu.no/~kentda/ ]___/~ ))\_student_/(( \__d L b__/ NTNU - graduate engineering - 5. year ) ( \__\_�|�_/__/ ) _)Industrial economics and technological management( \____/_�_\____/ (____engineering.discipline_=_Computer::Technology___)