[comp.sys.amiga.programmer] Arexx file dates ?

tron1@tronsbox.xei.com (Kenneth Jamieson) (04/29/91)

	From Amiga REXX .. how does one access the filedate ????

	Thanks!
-- 
========[ Xanadu Enterprises Inc. Amiga & Unix Software Development]=======
= "I know how you feel, you don't know if you want to hit me or kiss me - =
=  --- I get a lot of that."  Madonna as Breathless Mahoney (Dick Tracy)  =
=========== Ken Jamieson: uunet!tronsbox.xei.com!tron1  ===================
=     NONE of the opinions represented here are endorsed by anybody.      =
=  Unix is (tm) AT&T, Amiga is (tm) Commodore Business Machines, and all  =
=  characters from Dick Tracy are (tm) Warner Bros.                       =
===========================================================================

peterk@cbmger.UUCP (Peter Kittel GERMANY) (04/30/91)

In article <1589@tronsbox.xei.com> tron1@tronsbox.xei.com (Kenneth Jamieson) writes:
>
>	From Amiga REXX .. how does one access the filedate ????

I would do it just like in AmigaBASIC: Execute the DOS list command
from your script (address command...), output redirected to a temp file
in RAM:, and then parse those output lines, afterwards naturally cleaning
up by deleting that temp file. (The latter action is often forgotten,
even in some scripts on the WB disk... (I already sent a bugreport.))

-- 
Best regards, Dr. Peter Kittel  // E-Mail to  \\  Only my personal opinions... 
Commodore Frankfurt, Germany  \X/ {uunet|pyramid|rutgers}!cbmvax!cbmger!peterk

Richard_Sullivan@mindlink.bc.ca (Richard Sullivan) (05/01/91)

There is a much simpler way to get the date:
   say date('n',word(statef(file_name),5))

mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) (05/02/91)

   In article <1589@tronsbox.xei.com> tron1@tronsbox.xei.com (Kenneth Jamieson) writes:
   >
   >	From Amiga REXX .. how does one access the filedate ????

Use the STATEF function (in the support library). It returns the file
type, size, protection bits, date (in terms days, minutes and ticks),
and the comment. Something like:

	parse value statef(filename) with . . . . days minutes ticks .

(you'll have to look at the docs to get the right number of "."'s.)

	<mike
--
Look at my hopes,					Mike Meyer
Look at my dreams.					mwm@pa.dec.com
The currency we've spent,				decwrl!mwm
I love you. You pay my rent.

mwm@pa.dec.com (Mike (My Watch Has Windows) Meyer) (05/03/91)

In article <5695@mindlink.bc.ca> Richard_Sullivan@mindlink.bc.ca (Richard Sullivan) writes:
   There is a much simpler way to get the date:
      say date('n',word(statef(file_name),5))

That's an excellent way to get the day a file was created. If you want
something more accurate (i.e. - the time on that day), I'd use the
parse version. Date/time are good tools for turning the numbers
returned by statef into text strings suitable for printing.

Of course, there are more interesting things to do with file dates
than just print them....

	<mike
--
Don't tell me how to live my life			Mike Meyer
Don't tell me what to do				mwm@pa.dec.com
Repression is always brought about			decwrl!mwm
by people with politics and attitudes like you.

tron1@tronsbox.xei.com (Kenneth Jamieson) (05/03/91)

	Thanks a lot for the help gang!


-- 
========[ Xanadu Enterprises Inc. Amiga & Unix Software Development]=======
= "I know how you feel, you don't know if you want to hit me or kiss me - =
=  --- I get a lot of that."  Madonna as Breathless Mahoney (Dick Tracy)  =
=========== Ken Jamieson: uunet!tronsbox.xei.com!tron1  ===================
=     NONE of the opinions represented here are endorsed by anybody.      =
=  Unix is (tm) AT&T, Amiga is (tm) Commodore Business Machines, and all  =
=  characters from Dick Tracy are (tm) Warner Bros.                       =
===========================================================================