Mercurial Hosting > luan
comparison src/luan/modules/IoLuan.java @ 1661:08177ced7fa0
add file.copy_to
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 02 May 2022 18:56:55 -0600 |
parents | c922446f53aa |
children | d6a50ed9604f |
comparison
equal
deleted
inserted
replaced
1660:2968e43cdd44 | 1661:08177ced7fa0 |
---|---|
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 'rename_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 { | |
457 File dest = objToFile(luan,destObj); | |
458 if( dest==null ) | |
459 throw new LuanException( "bad argument #1 to 'rename_to' (string or file table expected)" ); | |
460 IoUtils.copy(file,dest); | |
461 } | |
462 | |
456 public void link_from(Luan luan,Object linkObj) throws LuanException, IOException { | 463 public void link_from(Luan luan,Object linkObj) throws LuanException, IOException { |
457 File link = objToFile(luan,linkObj); | 464 File link = objToFile(luan,linkObj); |
458 if( link==null ) | 465 if( link==null ) |
459 throw new LuanException( "bad argument #1 to 'link_from' (string or file table expected)" ); | 466 throw new LuanException( "bad argument #1 to 'link_from' (string or file table expected)" ); |
460 IoUtils.link(file,link); | 467 IoUtils.link(file,link); |