Mercurial Hosting > luan
changeset 764:d2f61d5be9cc
add file.delete_on_exit()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 26 Jul 2016 17:22:14 -0600 |
parents | 98df1c19ed7d |
children | 55983a476a21 |
files | core/src/luan/modules/IoLuan.java |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
diff -r 98df1c19ed7d -r d2f61d5be9cc core/src/luan/modules/IoLuan.java --- a/core/src/luan/modules/IoLuan.java Tue Jul 26 02:59:28 2016 -0600 +++ b/core/src/luan/modules/IoLuan.java Tue Jul 26 17:22:14 2016 -0600 @@ -494,7 +494,6 @@ public LuanTable create_temp_file(LuanState luan,String prefix,String suffix) throws LuanException, IOException { File tmp = File.createTempFile(prefix,suffix,file); - tmp.deleteOnExit(); return new LuanFile(luan,tmp).table(); } @@ -536,6 +535,9 @@ tbl.rawPut( "delete", new LuanJavaFunction( LuanFile.class.getMethod( "delete" ), this ) ); + tbl.rawPut( "delete_on_exit", new LuanJavaFunction( + File.class.getMethod( "deleteOnExit" ), file + ) ); tbl.rawPut( "mkdir", new LuanJavaFunction( LuanFile.class.getMethod( "mkdir" ), this ) );