[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby1.8.6 File.utime question.

zswu

11/3/2008 3:56:00 PM

Hi,

Because of my poor English, I beg there would be some kind guy could
understand me ... :)

I'm facing a strange problem. Please check code bleow:

time = Time.local( 2008, 'oct', 30, 11, 25, 37 ) # Thu Oct 30
11:25:37 +0800 2008
File.utime Time.now, time, pathname
File.open pathname do | f |
print f.mtime # Thu
Oct 30 11:25:38 +0800 2008
end

The result would be 1sec faster than the required value. But if setted
mtime as Time.local( 2008, 'oct', 30, 11, 25, 40 ), there would be no
problem.
It seems like the odd second value has been aligned at 2.

I have tested this problem at two different computers:
1. PC: Intel Core2 + WinXP SP3 + Ruby1.8.6 <--------- This is Ok
2. Laptop: Inter Core1 + WinXP SP2 + Ruby1.8.6 <--------- Wrong ....

Could someone tell me what had happened ?

--
Thanks,
best regards.

------------------------------------------------
im a programer....
Who care ?
------------------------------------------------

2 Answers

Nobuyoshi Nakada

11/3/2008 5:49:00 PM

0

Hi,

At Tue, 4 Nov 2008 00:55:44 +0900,
zswu wrote in [ruby-talk:319277]:
> It seems like the odd second value has been aligned at 2.
>
> I have tested this problem at two different computers:
> 1. PC: Intel Core2 + WinXP SP3 + Ruby1.8.6 <--------- This is Ok
> 2. Laptop: Inter Core1 + WinXP SP2 + Ruby1.8.6 <--------- Wrong ....

FAT based file system has no capability to store the odd second
value.

--
Nobu Nakada

zswu

11/3/2008 11:46:00 PM

0

Hi Nakada,

Thanks very much. I'm going to try :)

On Tue, Nov 4, 2008 at 1:49 AM, Nobuyoshi Nakada <nobu@ruby-lang.org> wrote:
> Hi,
>
> At Tue, 4 Nov 2008 00:55:44 +0900,
> zswu wrote in [ruby-talk:319277]:
>> It seems like the odd second value has been aligned at 2.
>>
>> I have tested this problem at two different computers:
>> 1. PC: Intel Core2 + WinXP SP3 + Ruby1.8.6 <--------- This is Ok
>> 2. Laptop: Inter Core1 + WinXP SP2 + Ruby1.8.6 <--------- Wrong ....
>
> FAT based file system has no capability to store the odd second
> value.
>
> --
> Nobu Nakada
>
>



--
Thanks,
best regards.

------------------------------------------------
im a programer....
Who care ?
------------------------------------------------