On Apr 13, 7:43=A0am, "Park Heesob" <phasi... / hotmail.com> wrote:
> Hi,
>
>
>
> ----- Original Message -----
> From: "Daniel Berger" <djber... / gmail.com>
> To: "ruby-talk ML" <ruby-t... / ruby-lang.org>
> Sent: Sunday, April 13, 2008 9:15 PM
> Subject: umask vs umask
>
> > Hi,
>
> > Windows XP Home
> > Ruby 1.8.6 p114
>
> > I think I need another set of eyes on this one, because it looks to me
> > like Ruby isn't picking up the changes I make with a custom umask, and
> > vice versa.
>
> > require 'win32/api'
> > include Win32
>
> > S_IWRITE =3D 0000200
> > S_IREAD =A0=3D 0000400
>
> > Umask =3D API.new('_umask', 'I', 'I', 'msvcrt')
>
> > # Mimic file.c
> > def umask(*args)
> > =A0 =A0omask =3D 0
>
> > =A0 =A0if args.length =3D=3D 0
> > =A0 =A0 =A0 omask =3D Umask.call(0)
> > =A0 =A0 =A0 Umask.call(omask)
> > =A0 =A0elsif args.length =3D=3D 1
> > =A0 =A0 =A0 omask =3D Umask.call(args[0])
> > =A0 =A0else
> > =A0 =A0 =A0 raise ArgumentError, "wrong number of arguments"
> > =A0 =A0end
>
> > =A0 =A0return omask
> > end
>
> > p umask(S_IREAD) # 0
> > p umask =A0 =A0 =A0 =A0 =A0# 256 (ok)
> > p umask =A0 =A0 =A0 =A0 =A0# 256 (double check, ok)
>
> > p File.umask =A0 =A0 # 0 - wtf?
>
> > Why isn't Ruby's File.umask picking up the change? I see the same thing
> > if I set it with File.umask and try to read the changes with my own umas=
k.
>
> In my Windows XP Home & Pro, with ruby 1.8.6 p111,
> the File.umask works fine.

I noticed that it works as expected when I use the one click installer
but not when I use a Ruby built with VC++ 8.

Are you seeing the same thing?

Regards,

Dan