提交 e30e06d1 编写于 作者: B Benjamin Pasero

use raw method for now to avoid event spam

上级 04f54116
......@@ -11,6 +11,7 @@ import * as paths from 'vs/base/common/paths';
import { dirname, join } from 'path';
import { nfcall, Queue } from 'vs/base/common/async';
import * as fs from 'fs';
import * as os from 'os';
import * as platform from 'vs/base/common/platform';
import { once } from 'vs/base/common/event';
......@@ -177,3 +178,11 @@ export function dirExists(path: string): TPromise<boolean> {
export function fileExists(path: string): TPromise<boolean> {
return stat(path).then(stat => stat.isFile(), () => false);
}
/**
* Deletes a path from disk.
*/
const tmpDir = os.tmpdir();
export function del(path: string, tmp = tmpDir): TPromise<void> {
return nfcall(extfs.del, path, tmp);
}
\ No newline at end of file
......@@ -177,7 +177,7 @@ export class BackupFileService implements IBackupFileService {
return void 0;
}
return this.fileService.del(backupResource).then(() => model.remove(backupResource));
return pfs.del(backupResource.fsPath).then(() => model.remove(backupResource));
});
}
......@@ -187,7 +187,7 @@ export class BackupFileService implements IBackupFileService {
return void 0;
}
return this.fileService.del(Uri.file(this.backupWorkspacePath)).then(() => model.clear());
return pfs.del(this.backupWorkspacePath).then(() => model.clear());
});
}
......
......@@ -471,7 +471,7 @@ export class FileService implements IFileService {
public del(resource: uri): TPromise<void> {
const absolutePath = this.toAbsolutePath(resource);
return nfcall(extfs.del, absolutePath, this.tmpPath).then(() => {
return pfs.del(absolutePath, this.tmpPath).then(() => {
// Events
this._onAfterOperation.fire(new FileOperationEvent(resource, FileOperation.DELETE));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册