Skip to content

Commit cdfa71e

Browse files
committed
1.1.208
1 parent 1729ab8 commit cdfa71e

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

FileSystem/ExtendedAttributes/DefaultExtendedAttribute.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { ExtendedAttribute } from "./ExtendedAttribute";
2-
import { readFile, writeFile, unlink } from "fs";
2+
import { readFile, writeFile, unlink, statSync, utimesSync } from "fs";
33
import { promisify } from "util";
44

5-
65
export class DefaultExtendedAttribute implements ExtendedAttribute {
76

87
/**
@@ -11,7 +10,13 @@ export class DefaultExtendedAttribute implements ExtendedAttribute {
1110
async setExtendedAttribute(path: string, attribName: string, attribValue: string): Promise<void> {
1211
if (!path) throw new Error("path")
1312
if (!attribName) throw new Error("attribName");
13+
14+
const stat = statSync(path);
15+
1416
await promisify(writeFile)(`${path}:${attribName}`, attribValue);
17+
18+
//Preserve last modification date.
19+
utimesSync(path, stat.atime, stat.mtime);
1520
}
1621

1722
/**

FileSystem/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ithit.webdav.server.filesystem",
3-
"version": "1.1.201",
3+
"version": "1.1.208",
44
"description": "A cross-platform WebDAV Node.js server that runs on Windows, Mac OS X and Linux. This example is a fully-functional WebDAV server that can be used to open, edit and save Microsoft Office documents directly to server, without download/upload steps.",
55
"author": "IT Hit, Ltd",
66
"license": "IT Hit LTD.",

0 commit comments

Comments
 (0)