提交 c9116be9 编写于 作者: S sherman

8015728: (zipfs) demo/zipfs/basic.sh failing

Summary: to return the correct loc entry size from wirteLOC();
Reviewed-by: alanb
上级 2f81df1c
...@@ -1940,7 +1940,6 @@ public class ZipFileSystem extends FileSystem { ...@@ -1940,7 +1940,6 @@ public class ZipFileSystem extends FileSystem {
if (elen64 != 0) { if (elen64 != 0) {
elen64 += 4; // header and data sz 4 bytes elen64 += 4; // header and data sz 4 bytes
} }
while (eoff + 4 < elen) { while (eoff + 4 < elen) {
int tag = SH(extra, eoff); int tag = SH(extra, eoff);
int sz = SH(extra, eoff + 2); int sz = SH(extra, eoff + 2);
...@@ -1995,7 +1994,6 @@ public class ZipFileSystem extends FileSystem { ...@@ -1995,7 +1994,6 @@ public class ZipFileSystem extends FileSystem {
writeLong(os, locoff); writeLong(os, locoff);
} }
if (elenNTFS != 0) { if (elenNTFS != 0) {
// System.out.println("writing NTFS:" + elenNTFS);
writeShort(os, EXTID_NTFS); writeShort(os, EXTID_NTFS);
writeShort(os, elenNTFS - 4); writeShort(os, elenNTFS - 4);
writeInt(os, 0); // reserved writeInt(os, 0); // reserved
...@@ -2197,7 +2195,7 @@ public class ZipFileSystem extends FileSystem { ...@@ -2197,7 +2195,7 @@ public class ZipFileSystem extends FileSystem {
if (extra != null) { if (extra != null) {
writeBytes(os, extra); writeBytes(os, extra);
} }
return LOCHDR + name.length + elen + elen64 + elenEXTT; return LOCHDR + name.length + elen + elen64 + elenNTFS + elenEXTT;
} }
// Data Descriptior // Data Descriptior
......
...@@ -341,6 +341,9 @@ public class ZipFSTester { ...@@ -341,6 +341,9 @@ public class ZipFSTester {
// test file stamp // test file stamp
static void testTime(Path src) throws Exception { static void testTime(Path src) throws Exception {
BasicFileAttributes attrs = Files
.getFileAttributeView(src, BasicFileAttributeView.class)
.readAttributes();
// create a new filesystem, copy this file into it // create a new filesystem, copy this file into it
Map<String, Object> env = new HashMap<String, Object>(); Map<String, Object> env = new HashMap<String, Object>();
env.put("create", "true"); env.put("create", "true");
...@@ -352,10 +355,6 @@ public class ZipFSTester { ...@@ -352,10 +355,6 @@ public class ZipFSTester {
Path dst = getPathWithParents(fs, "me"); Path dst = getPathWithParents(fs, "me");
Files.copy(src, dst, COPY_ATTRIBUTES); Files.copy(src, dst, COPY_ATTRIBUTES);
checkEqual(src, dst); checkEqual(src, dst);
BasicFileAttributes attrs = Files
.getFileAttributeView(src, BasicFileAttributeView.class)
.readAttributes();
System.out.println("mtime: " + attrs.lastModifiedTime()); System.out.println("mtime: " + attrs.lastModifiedTime());
System.out.println("ctime: " + attrs.creationTime()); System.out.println("ctime: " + attrs.creationTime());
System.out.println("atime: " + attrs.lastAccessTime()); System.out.println("atime: " + attrs.lastAccessTime());
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
# #
# @test # @test
# @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596 # @bug 6990846 7009092 7009085 7015391 7014948 7005986 7017840 7007596
# 7157656 8002390 7012868 7012856 # 7157656 8002390 7012868 7012856 8015728
# @summary Test ZipFileSystem demo # @summary Test ZipFileSystem demo
# @build Basic PathOps ZipFSTester # @build Basic PathOps ZipFSTester
# @run shell basic.sh # @run shell basic.sh
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册