Hi,

Daniel Berger wrote:
> On Apr 13, 7:43?am, "Park Heesob" <phasi... / hotmail.com> wrote:
>> > Hi,
>>
>> > ? ? ? omask = Umask.call(0)
>> > p umask(S_IREAD) # 0
>> > p umask ? ? ? ? ?# 256 (ok)
>> > p umask ? ? ? ? ?# 256 (double check, ok)
>>
>> > p File.umask ? ? # 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 umask.
>>
>> 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?
> 
Yes, I tested with VC++ 9.
It fails as same as your test.
I guess "msvcrt" is valid for VC++ 6.
The situation became more complex since VC++ 8.

Refer to http://msdn2.microsoft.com/en-us/library/abx4dbyh(VS.80).aspx

You should modify the line

Umask = API.new('_umask', 'I', 'I', 'msvcrt')

to

Umask = API.new('_umask', 'I', 'I', 'msvcr80')

It requires Microsoft Visual C++ 2005 SP1 Redistributable Package (x86)
http://www.microsoft.com/downloads/details.aspx?FamilyID=200B2FD9-AE1A-4A14-984D-389C36F85647

Regards,

Park Heesob

-- 
Posted via http://www.ruby-forum.com/.