Mercurial Hosting > luan
comparison core/src/luan/modules/IoLuan.java @ 768:ef0fc9ad30c1
add file.set_last_modified()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 07 Aug 2016 21:03:14 -0600 |
parents | 55983a476a21 |
children |
comparison
equal
deleted
inserted
replaced
767:fec01f044474 | 768:ef0fc9ad30c1 |
---|---|
518 if( !file.mkdirs() ) | 518 if( !file.mkdirs() ) |
519 throw new LuanException("couldn't make directory "+file); | 519 throw new LuanException("couldn't make directory "+file); |
520 } | 520 } |
521 } | 521 } |
522 | 522 |
523 public void set_last_modified(long time) throws LuanException { | |
524 if( !file.setLastModified(time) ) | |
525 throw new LuanException("couldn't set_last_modified on "+file); | |
526 } | |
527 | |
523 @Override public LuanTable table() { | 528 @Override public LuanTable table() { |
524 LuanTable tbl = super.table(); | 529 LuanTable tbl = super.table(); |
525 try { | 530 try { |
526 tbl.rawPut( "name", new LuanJavaFunction( | 531 tbl.rawPut( "name", new LuanJavaFunction( |
527 File.class.getMethod( "getName" ), file | 532 File.class.getMethod( "getName" ), file |
541 tbl.rawPut( "mkdir", new LuanJavaFunction( | 546 tbl.rawPut( "mkdir", new LuanJavaFunction( |
542 LuanFile.class.getMethod( "mkdir" ), this | 547 LuanFile.class.getMethod( "mkdir" ), this |
543 ) ); | 548 ) ); |
544 tbl.rawPut( "last_modified", new LuanJavaFunction( | 549 tbl.rawPut( "last_modified", new LuanJavaFunction( |
545 File.class.getMethod( "lastModified" ), file | 550 File.class.getMethod( "lastModified" ), file |
551 ) ); | |
552 tbl.rawPut( "set_last_modified", new LuanJavaFunction( | |
553 LuanFile.class.getMethod( "set_last_modified", Long.TYPE ), this | |
546 ) ); | 554 ) ); |
547 tbl.rawPut( "length", new LuanJavaFunction( | 555 tbl.rawPut( "length", new LuanJavaFunction( |
548 File.class.getMethod( "length" ), file | 556 File.class.getMethod( "length" ), file |
549 ) ); | 557 ) ); |
550 tbl.rawPut( "child", new LuanJavaFunction( | 558 tbl.rawPut( "child", new LuanJavaFunction( |