Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Changing the timestamp on a file ?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Changing the timestamp on a file ?
#11793
Posted by: DougA 2007-09-11 01:31:13 Last edited by: Jeff Glatt 2009-03-04 14:57:50 (Total edited 1 time)
Is there a way to change the timestamp (date and time) of a file?
Doug
Message2.
#11810
Posted by: Jeff Glatt 2007-09-12 02:17:36 Last edited by: Jeff Glatt 2009-03-04 14:57:09 (Total edited 1 time)
Use the FILEDATE function.
Message3. After a search, I found the above refernece to FILEDATE
#13229
Posted by: Michael S 2010-02-24 20:48:41
but couldn't find any help on using it. I assume it's what I want - I want to copy a file fro A to B and ensure that the date/time for B is shown as "right now" (rather than A's  date/time which seems to be happening for me)
Message4.
#13230
Posted by: DougA 2010-03-04 05:06:15
Michael, when I highlight "filedate" in RPC, and hit F1, the help page comes up.
In short the structure is:  FILEDATE(filename, option, datetime)
  where option is:  'A' - Last accessed, 'C' - Creation, 'M' - Last modified
  and time is  "yyyymmdd hh:mm:ss"
  If time is omitted, the the function is a query and returns the specified value.
Doug
Message5. Obviously don't have the latest online help, 'cos I DON'T see any info for FILEDATE
#13231
Posted by: Michael S 2010-03-04 15:55:24
At the same time, I tried going to
http://home.roadrunner.com/~jgglatt/rexx/rexxuser.htm
(from the sticky updates topic) to get the latest help, but that is either in trouble or temporarily down.
Message6. Tried the example you specified (?)
#13232
Posted by: Michael S 2010-03-04 16:00:42 Last edited by: Michael S 2010-03-04 16:01:01 (Total edited 1 time)

filename = "K4605020.cbl"
y = filedate(filename)
SAY y

and received err 43.1 "Could not find routine ......../filedate.rex"

Am I missing something ?
Message7.
#13233
Posted by: DougA 2010-03-06 04:01:26
The link must have been down, as it's working for me.
I'd suggest reloading the software as well as the doc.
Doug
Message8. Thanks for the suggestion Doug.
#13234
Posted by: Michael S 2010-03-08 15:34:03
That did the trick (Reginald must have been updated without my noticing)
Message9. Okay - I installed updated Reginald, but it still failed
#13235
Posted by: Michael S 2010-03-08 16:56:00
Here's my test example

filename = "K4605020.cbl"
y = filedate(filename)
SAY y
/* Updating via filedate requires a format of yyyyMMdd hr:mn:sc */
temp = DATE("S")" "TIME("N")
SAY "temp = "temp
y = filedate(filename, "M", temp)
SAY y

Temp contains "20100308 09:51:40", but the results are shown in the attachment

Filedate_results.png
Message10. Tried the sample, it worked for me
#13244
Posted by: DougA 2010-03-12 01:20:58
Michael,  ran your test example and it worked fine, maybe Jeff can help.
Or try another reload of the software, something seems confused.
Anyway, your code is good, should work.
Doug
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0