comparison core/src/luan/modules/IoLuan.java @ 323:cd2924a1052c

improve testing git-svn-id: https://luan-java.googlecode.com/svn/trunk@324 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Mon, 09 Feb 2015 04:33:21 +0000
parents 7c4f52262213
children 23b99a5039b5
comparison
equal deleted inserted replaced
322:f8ece87df2b1 323:cd2924a1052c
398 list.add(new LuanFile(luan,f).table()); 398 list.add(new LuanFile(luan,f).table());
399 } 399 }
400 return list; 400 return list;
401 } 401 }
402 402
403 public LuanTable parent(LuanState luan) throws LuanException, IOException {
404 File parent = file.getParentFile();
405 if( parent==null )
406 parent = file.getCanonicalFile().getParentFile();
407 return new LuanFile(luan,parent).table();
408 }
409
403 @Override public boolean exists() { 410 @Override public boolean exists() {
404 return file.exists(); 411 return file.exists();
405 } 412 }
406 413
407 public boolean rename_to(String dest) { 414 public boolean rename_to(String dest) {
439 tbl.put( "child", new LuanJavaFunction( 446 tbl.put( "child", new LuanJavaFunction(
440 LuanFile.class.getMethod( "child", LuanState.class, String.class ), this 447 LuanFile.class.getMethod( "child", LuanState.class, String.class ), this
441 ) ); 448 ) );
442 tbl.put( "children", new LuanJavaFunction( 449 tbl.put( "children", new LuanJavaFunction(
443 LuanFile.class.getMethod( "children", LuanState.class ), this 450 LuanFile.class.getMethod( "children", LuanState.class ), this
451 ) );
452 tbl.put( "parent", new LuanJavaFunction(
453 LuanFile.class.getMethod( "parent", LuanState.class ), this
444 ) ); 454 ) );
445 tbl.put( "rename_to", new LuanJavaFunction( 455 tbl.put( "rename_to", new LuanJavaFunction(
446 LuanFile.class.getMethod( "rename_to", String.class ), this 456 LuanFile.class.getMethod( "rename_to", String.class ), this
447 ) ); 457 ) );
448 tbl.put( "canonical", new LuanJavaFunction( 458 tbl.put( "canonical", new LuanJavaFunction(