diff --git a/websocketfs/lib/metadata-file.ts b/websocketfs/lib/metadata-file.ts index 96377a2..781f6c2 100644 --- a/websocketfs/lib/metadata-file.ts +++ b/websocketfs/lib/metadata-file.ts @@ -110,10 +110,13 @@ export class MetadataFile { return { errno: -2 }; } const data = v[1].split(" "); - const mtime = new Date(parseFloat(data[0]) * 1000); + // note that we intentionally use parseInt and throw away info + // that might be in the file. This is for consistency with + // the non-cached version of things. + const mtime = new Date(parseInt(data[0]) * 1000); const attr = { mtime, - atime: new Date(parseFloat(data[1]) * 1000), + atime: new Date(parseInt(data[1]) * 1000), ctime: mtime, blocks: parseInt(data[2]), size: parseInt(data[3]), diff --git a/websocketfs/lib/mount.ts b/websocketfs/lib/mount.ts index 5d3fe2c..6a38672 100644 --- a/websocketfs/lib/mount.ts +++ b/websocketfs/lib/mount.ts @@ -32,9 +32,10 @@ interface Options { // [filename-relative-to-mount-point-no-leading-/.]\0[mtime in seconds] [atime in seconds] [number of 512-byte blocks] [size] [symbolic mode string]\0\0 // This file is *not* assumed to be sorted (it's a 1-line file, so hard to sort in unix anyways). // Here all of mtime, atime, blocks, size are decimal numbers, which may have a fractional part, - // and mode is a string like in ls. E.g., this find command does it (ignoring hidden files):: + // and mode is a string like in ls. E.g., this find command does it (ignoring hidden files). + // Y2K alert -- note the %.10T truncates times to integers, and will I guess fail a few hundred years from now. // - // mkdir -p /tmp/meta; find * -printf "%p\0%T@ %A@ %b %s %M\0\0" | lz4 > .meta.lz4 && mv .meta.lz4 /tmp/meta/meta.lz4 + // mkdir -p /tmp/meta; find * -printf "%p\0%.10T@ %.10A@ %b %s %M\0\0" | lz4 > .meta.lz4 && mv .meta.lz4 /tmp/meta/meta.lz4 // // PATCHES: (This does not exist yet!) If metadataFile ends in .lz4 it is assumed to be lz4 compressed and gets automatically decompressed. // If there are files metadataFile.patch.[n] (with n an integer), then they are diff-match-patch patches diff --git a/websocketfs/lib/util.ts b/websocketfs/lib/util.ts index ab0f3c2..ad92464 100644 --- a/websocketfs/lib/util.ts +++ b/websocketfs/lib/util.ts @@ -41,6 +41,8 @@ export function symbolicToMode(symbolic): number { let mode; if (symbolic.charAt(0) === "d") { mode = "40"; + } else if (symbolic.charAt(0) === "l") { + mode = "120"; } else { mode = "100"; } diff --git a/websocketfs/package.json b/websocketfs/package.json index a7c8dc8..76ffd78 100644 --- a/websocketfs/package.json +++ b/websocketfs/package.json @@ -1,6 +1,6 @@ { "name": "websocketfs", - "version": "0.13.0", + "version": "0.13.1", "description": "Like sshfs, but over a WebSocket", "main": "./dist/lib/index.js", "scripts": {