diff src/luan/lib/OsLib.java @ 147:cc3a0578edac

fix Io.reverse_pickle git-svn-id: https://luan-java.googlecode.com/svn/trunk@148 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Sun, 15 Jun 2014 15:41:36 +0000
parents 0517a4a7fcc5
children 138b9baee80b
line wrap: on
line diff
--- a/src/luan/lib/OsLib.java	Sun Jun 15 13:35:33 2014 +0000
+++ b/src/luan/lib/OsLib.java	Sun Jun 15 15:41:36 2014 +0000
@@ -45,7 +45,7 @@
 			return new IoLib.LuanFile(file).table();
 		}
 
-		public LuanTable list_children() {
+		public LuanTable children() {
 			File[] files = file.listFiles();
 			if( files==null )
 				return null;
@@ -59,8 +59,11 @@
 		LuanTable table() {
 			LuanTable tbl = new LuanTable();
 			try {
+				tbl.put( "to_string", new LuanJavaFunction(
+					File.class.getMethod( "toString" ), file
+				) );
 				tbl.put( "name", new LuanJavaFunction(
-					File.class.getMethod( "toString" ), file
+					File.class.getMethod( "getName" ), file
 				) );
 				tbl.put( "exists", new LuanJavaFunction(
 					File.class.getMethod( "exists" ), file
@@ -89,8 +92,8 @@
 				tbl.put( "io_file", new LuanJavaFunction(
 					LuanFile.class.getMethod( "io_file" ), this
 				) );
-				tbl.put( "list_children", new LuanJavaFunction(
-					LuanFile.class.getMethod( "list_children" ), this
+				tbl.put( "children", new LuanJavaFunction(
+					LuanFile.class.getMethod( "children" ), this
 				) );
 			} catch(NoSuchMethodException e) {
 				throw new RuntimeException(e);