Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/File-modification-time/E/file-modification-time.e
Normal file
16
Task/File-modification-time/E/file-modification-time.e
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
def strdate(date) {
|
||||
return E.toString(<unsafe:java.util.makeDate>(date))
|
||||
}
|
||||
|
||||
def test(type, file) {
|
||||
def t := file.lastModified()
|
||||
println(`The following $type called ${file.getPath()} ${
|
||||
if (t == 0) { "does not exist." } else { `was modified at ${strdate(t)}` }}`)
|
||||
println(`The following $type called ${file.getPath()} ${
|
||||
escape ne { file.setLastModified(timer.now(), ne); "was modified to current time." } catch _ { "does not exist." }}`)
|
||||
println(`The following $type called ${file.getPath()} ${
|
||||
escape ne { file.setLastModified(t, ne); "was modified to previous time." } catch _ { "does not exist." }}`)
|
||||
}
|
||||
|
||||
test("file", <file:output.txt>)
|
||||
test("directory", <file:docs>)
|
||||
Loading…
Add table
Add a link
Reference in a new issue