File modification time: Difference between revisions

(Updated D entry)
Line 753:
#Set the access and modification times to the current time:
File.utime(nil, nil, 'path')</lang>
 
 
=={{header|Run BASIC}}==
<lang runbasic>files #f, DefaultDir$ + "\*.*" ' all files in the defalt directory
print "hasanswer: ";#f HASANSWER() ' does it exist
print "rowcount: ";#f ROWCOUNT() ' number of files in the directory
print '
#f DATEFORMAT("mm/dd/yy") ' set format of file date to template given
#f TIMEFORMAT("hh:mm:ss") ' set format of file time to template given
 
for i = 1 to #f rowcount() ' loop through the files
if #f hasanswer() then
print "nextfile info: ";#f nextfile$(" ") ' set the delimiter for nextfile info
print "name: ";name$ ' file name
print "size: ";#f SIZE() ' file size
print "date: ";#f DATE$() ' file date
print "time: ";#f TIME$() ' file time
print "isdir: ";#f ISDIR() ' is it a directory or file
 
name$ = #f NAME$()
shell$("touch -t 201002032359.59 ";name$;""") ' sell to os to set date
 
print
end if
next</lang>
 
=={{header|Seed7}}==
Anonymous user