FILE and stamp

4 Messages Forum Options Options
Embed this topic
Permalink
andersoxie
FILE and stamp
Reply Threaded MoreMore options
Print post
Permalink
Hej

I am trying to use the feature "stamp" in class FILE but I can not get
it to work. Do somebody know about an example I can look at. I am using
Windows.

Regards

Anders

Emmanuel Stapf
RE: FILE and stamp
Reply Threaded MoreMore options
Print post
Permalink
What is not working exactly? The `time' argument is the number of elapsed seconds
since January 1st 1970.

Regards,
Manu

> -----Original Message-----
> From: eiffel_software@...
> [mailto:eiffel_software@...] On Behalf Of andersoxie
> Sent: Wednesday, August 20, 2008 5:32 AM
> To: eiffel_software@...
> Subject: [eiffel_software] FILE and stamp
>
> Hej
>
> I am trying to use the feature "stamp" in class FILE but I can not get
> it to work. Do somebody know about an example I can look at. I am using
> Windows.
>
> Regards
>
> Anders
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------  
andersoxie
Re: FILE and stamp
Reply Threaded MoreMore options
Print post
Permalink
Hej

I do like this

create new_file.make ( "C:\test.txt" )

new_file.open_write

-- Write to new_file

new_file.close

new_file.stamp (other_file.date)


I thought that the new_file would get the same creation time as
the "other_file". If the above seems correct I can try to reproduce
it in a small example.

Regards

Anders

--- In eiffel_software@..., "Emmanuel Stapf [ES]"
<manus@...> wrote:
>
> What is not working exactly? The `time' argument is the number of
elapsed seconds

> since January 1st 1970.
>
> Regards,
> Manu
>
> > -----Original Message-----
> > From: eiffel_software@...
> > [mailto:eiffel_software@...] On Behalf Of andersoxie
> > Sent: Wednesday, August 20, 2008 5:32 AM
> > To: eiffel_software@...
> > Subject: [eiffel_software] FILE and stamp
> >
> > Hej
> >
> > I am trying to use the feature "stamp" in class FILE but I can
not get
> > it to work. Do somebody know about an example I can look at. I am
using

> > Windows.
> >
> > Regards
> >
> > Anders
> >
> >
> > ------------------------------------
> >
> > Yahoo! Groups Links
> >
> >
> >
>


Emmanuel Stapf
RE: Re: FILE and stamp
Reply Threaded MoreMore options
Print post
Permalink
It works for me. I've tested it under Windows XP Pro 64-bit (I assume it should be
pretty much the same for all the Windows version) from a DOS console and doing
`dir' I get:

6/10/2008  15:55               0  new_test.txt
6/10/2008  15:55           6,060  test.txt

`test.txt' was my original file and `new_test.txt' is the file I created using
your code and using `stamp'.

In Windows explorer both the accessed time and modified time are for June 10th
2008, but not the creation time which is set to today. This is definitely in line
with the specification of the `stamp' routine.

Maybe this depends on the file system being used (I use NTFS).

Regards,
Manu

------------------------------------------------------------------------  
Eiffel Software
805-685-1006
http://www.eiffel.com       
Customer support: http://support.eiffel.com       
User group: http://groups.eiffel.com/join       
------------------------------------------------------------------------