1 21 22 package org.armedbear.lisp; 23 24 import java.io.File ; 25 26 public final class file_write_date extends Primitive1 28 { 29 private file_write_date() 30 { 31 super("file-write-date"); 32 } 33 34 public LispObject execute(LispObject arg) throws ConditionThrowable 35 { 36 Pathname pathname = Pathname.coerceToPathname(arg); 37 if (pathname.isWild()) 38 signal(new FileError("Bad place for a wild pathname.")); 39 File file = Utilities.getFile(pathname); 40 long lastModified = file.lastModified(); 41 if (lastModified == 0) 42 return NIL; 43 return number(lastModified / 1000 + 2208988800L); 44 } 45 46 private static final Primitive1 FILE_WRITE_DATE = new file_write_date(); 47 } 48 | Popular Tags |