changeset 1662:d6a50ed9604f

file.move_to
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 May 2022 19:15:42 -0600
parents 08177ced7fa0
children 970e635c7196
files src/luan/host/main.luan src/luan/modules/Boot.luan src/luan/modules/IoLuan.java
diffstat 3 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
diff -r 08177ced7fa0 -r d6a50ed9604f src/luan/host/main.luan
--- a/src/luan/host/main.luan	Mon May 02 18:56:55 2022 -0600
+++ b/src/luan/host/main.luan	Mon May 02 19:15:42 2022 -0600
@@ -172,7 +172,7 @@
 	local new_dir = sites_dir.child(new_domain)
 	new_dir.exists() and error "new_domain already exists"
 	WebHandler.removeHandler(old_domain)
-	old_dir.rename_to(new_dir.to_string())
+	old_dir.move_to(new_dir.to_string())
 	WebHandler.removeHandler(old_domain)
 	WebHandler.loadHandler(new_domain)
 end
diff -r 08177ced7fa0 -r d6a50ed9604f src/luan/modules/Boot.luan
--- a/src/luan/modules/Boot.luan	Mon May 02 18:56:55 2022 -0600
+++ b/src/luan/modules/Boot.luan	Mon May 02 19:15:42 2022 -0600
@@ -192,7 +192,8 @@
 	this.last_modified = io.file.lastModified
 	this.set_last_modified = io.set_last_modified
 	this.length = io.file.length
-	this.rename_to = io.rename_to
+	this.move_to = io.move_to
+	this.rename_to = io.move_to  -- tmp
 	this.copy_to = io.copy_to
 	this.link_from = io.link_from
 	this.symlink_from = io.symlink_from
diff -r 08177ced7fa0 -r d6a50ed9604f src/luan/modules/IoLuan.java
--- a/src/luan/modules/IoLuan.java	Mon May 02 18:56:55 2022 -0600
+++ b/src/luan/modules/IoLuan.java	Mon May 02 19:15:42 2022 -0600
@@ -446,17 +446,17 @@
 			return file.exists();
 		}
 
-		public void rename_to(Luan luan,Object destObj) throws LuanException, IOException {
+		public void move_to(Luan luan,Object destObj) throws LuanException, IOException {
 			File dest = objToFile(luan,destObj);
 			if( dest==null )
-				throw new LuanException( "bad argument #1 to 'rename_to' (string or file table expected)" );
+				throw new LuanException( "bad argument #1 to 'move_to' (string or file table expected)" );
 			IoUtils.move(file,dest);
 		}
 
 		public void copy_to(Luan luan,Object destObj) throws LuanException, IOException {
 			File dest = objToFile(luan,destObj);
 			if( dest==null )
-				throw new LuanException( "bad argument #1 to 'rename_to' (string or file table expected)" );
+				throw new LuanException( "bad argument #1 to 'copy_to' (string or file table expected)" );
 			IoUtils.copy(file,dest);
 		}