changeset 310:9e9bb358b2df

add File.canonical() git-svn-id: https://luan-java.googlecode.com/svn/trunk@311 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Tue, 23 Dec 2014 07:07:17 +0000
parents 6bf47e28e0e5
children 22ca4f3a65c3
files core/src/luan/modules/IoLuan.java scripts/uninstall.sh
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/src/luan/modules/IoLuan.java	Tue Dec 23 05:50:22 2014 +0000
+++ b/core/src/luan/modules/IoLuan.java	Tue Dec 23 07:07:17 2014 +0000
@@ -375,6 +375,10 @@
 			return file.renameTo(new File(dest));
 		}
 
+		public LuanTable canonical(LuanState luan) throws LuanException, IOException {
+			return new LuanFile(luan,file.getCanonicalFile()).table();
+		}
+
 		@Override public LuanTable table() {
 			LuanTable tbl = super.table();
 			try {
@@ -408,6 +412,9 @@
 				tbl.put( "rename_to", new LuanJavaFunction(
 					LuanFile.class.getMethod( "rename_to", String.class ), this
 				) );
+				tbl.put( "canonical", new LuanJavaFunction(
+					LuanFile.class.getMethod( "canonical", LuanState.class ), this
+				) );
 			} catch(NoSuchMethodException e) {
 				throw new RuntimeException(e);
 			}
--- a/scripts/uninstall.sh	Tue Dec 23 05:50:22 2014 +0000
+++ b/scripts/uninstall.sh	Tue Dec 23 07:07:17 2014 +0000
@@ -1,5 +1,4 @@
 rm /usr/local/bin/luan
-
 cd `dirname $0`
 echo "luan has been uninstalled"
 echo "you can now delete `pwd`"