diff core/src/luan/modules/IoLuan.java @ 293:a50e88d3547c

add Web_server.init(); add File.rename_to(); git-svn-id: https://luan-java.googlecode.com/svn/trunk@294 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Thu, 11 Dec 2014 01:44:38 +0000
parents b669cdaf54b7
children 7ea6dfdf81ba
line wrap: on
line diff
--- a/core/src/luan/modules/IoLuan.java	Wed Dec 10 21:44:19 2014 +0000
+++ b/core/src/luan/modules/IoLuan.java	Thu Dec 11 01:44:38 2014 +0000
@@ -404,6 +404,10 @@
 			return file.exists();
 		}
 
+		public boolean rename_to(String dest) {
+			return file.renameTo(new File(dest));
+		}
+
 		@Override LuanTable table() {
 			LuanTable tbl = super.table();
 			try {
@@ -434,6 +438,9 @@
 				tbl.put( "children", new LuanJavaFunction(
 					LuanFile.class.getMethod( "children", LuanState.class ), this
 				) );
+				tbl.put( "rename_to", new LuanJavaFunction(
+					LuanFile.class.getMethod( "rename_to", String.class ), this
+				) );
 			} catch(NoSuchMethodException e) {
 				throw new RuntimeException(e);
 			}