comparison src/luan/modules/IoLuan.java @ 1662:d6a50ed9604f

file.move_to
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 02 May 2022 19:15:42 -0600
parents 08177ced7fa0
children 8f38abaf779f
comparison
equal deleted inserted replaced
1661:08177ced7fa0 1662:d6a50ed9604f
444 444
445 @Override public boolean exists() { 445 @Override public boolean exists() {
446 return file.exists(); 446 return file.exists();
447 } 447 }
448 448
449 public void rename_to(Luan luan,Object destObj) throws LuanException, IOException { 449 public void move_to(Luan luan,Object destObj) throws LuanException, IOException {
450 File dest = objToFile(luan,destObj); 450 File dest = objToFile(luan,destObj);
451 if( dest==null ) 451 if( dest==null )
452 throw new LuanException( "bad argument #1 to 'rename_to' (string or file table expected)" ); 452 throw new LuanException( "bad argument #1 to 'move_to' (string or file table expected)" );
453 IoUtils.move(file,dest); 453 IoUtils.move(file,dest);
454 } 454 }
455 455
456 public void copy_to(Luan luan,Object destObj) throws LuanException, IOException { 456 public void copy_to(Luan luan,Object destObj) throws LuanException, IOException {
457 File dest = objToFile(luan,destObj); 457 File dest = objToFile(luan,destObj);
458 if( dest==null ) 458 if( dest==null )
459 throw new LuanException( "bad argument #1 to 'rename_to' (string or file table expected)" ); 459 throw new LuanException( "bad argument #1 to 'copy_to' (string or file table expected)" );
460 IoUtils.copy(file,dest); 460 IoUtils.copy(file,dest);
461 } 461 }
462 462
463 public void link_from(Luan luan,Object linkObj) throws LuanException, IOException { 463 public void link_from(Luan luan,Object linkObj) throws LuanException, IOException {
464 File link = objToFile(luan,linkObj); 464 File link = objToFile(luan,linkObj);