From: Daniel Berger Date: 2006-04-01T11:23:44+09:00 Subject: Re: Trying to get stat, Win32API to work Park Heesob wrote: > Hi, > > >From: "Berger, Daniel" > >Reply-To: ruby-talk@ruby-lang.org > >To: ruby-talk@ruby-lang.org (ruby-talk ML) > >Subject: Trying to get stat, Win32API to work > >Date: Sat, 1 Apr 2006 05:46:36 +0900 > > > >Hi all, > > > >Ruby 1.8.4 > >Windows XP > > > >I'm trying to make a pure Ruby version of File::Stat. Something seems > >to go wrong around the time I get rdev. I think I just need another set > >of eyes to see what I'm doing wrong here. > > > >Thanks, > > > >Dan > > > ># stat.rb > > > .. > > > It is due to the structure alignment. > Applications should generally align structure members at addresses that are > ^natural ̄ for the data type and the processor involved. For example, a > 4-byte data member should have an address that is a multiple of four. > > Refer to > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_core_structure_alignment.asp > > Your code should be like this: Aha! Thanks! Dan