提交 5fad066f 编写于 作者: B Benjamin Pasero

Wrong usage of fs.utimes (fixes #14645)

上级 9b74d12c
......@@ -101,8 +101,10 @@ export function readlink(path: string): TPromise<string> {
return nfcall<string>(fs.readlink, path);
}
export function utimes(path: string, atime: Date, mtime: Date): TPromise<void> {
return nfcall(fs.utimes, path, atime, mtime);
export function touch(path: string): TPromise<void> {
const now = Date.now() / 1000; // the value should be a Unix timestamp in seconds
return nfcall(fs.utimes, path, now, now);
}
export function readFile(path: string): TPromise<Buffer>;
......
......@@ -324,7 +324,7 @@ export class FileService implements IFileService {
return createPromise.then(() => {
// 3.) update atime and mtime
return pfs.utimes(absolutePath, new Date(), new Date()).then(() => {
return pfs.touch(absolutePath).then(() => {
// 4.) resolve
return this.resolve(resource);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册