changeset 755:ff865e954934

fix zip to preserve file time
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 18 Jul 2016 05:01:38 -0600
parents 1a101ac9ea46
children 9092e52f94eb
files core/src/luan/modules/IoLuan.java
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
diff -r 1a101ac9ea46 -r ff865e954934 core/src/luan/modules/IoLuan.java
--- a/core/src/luan/modules/IoLuan.java	Sun Jul 17 19:21:52 2016 -0600
+++ b/core/src/luan/modules/IoLuan.java	Mon Jul 18 05:01:38 2016 -0600
@@ -224,6 +224,7 @@
 				OutputStream out = new FileOutputStream(file);
 				Utils.copyAll(in,out);
 				out.close();
+				file.setLastModified(entry.getTime());
 			}
 			in.close();
 		}
@@ -368,7 +369,9 @@
 					if( !filePath.startsWith(basePath) )
 						throw new LuanException(filePath+" not in "+basePath);
 					String relPath = filePath.substring(basePath.length());
-					out.putNextEntry(new ZipEntry(relPath));
+					ZipEntry entry = new ZipEntry(relPath);
+					entry.setTime(file.lastModified());
+					out.putNextEntry(entry);
 					InputStream in = new FileInputStream(file);
 					Utils.copyAll(in,out);
 					in.close();