fs - remove promise based methods from pfs and replace with fs.promises

This commit is contained in:
Benjamin Pasero
2021-02-03 11:20:14 +01:00
parent a17c656c33
commit dbf6147c01
29 changed files with 134 additions and 157 deletions

View File

@@ -267,8 +267,8 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
let tcp: string = '';
let tcp6: string = '';
try {
tcp = await pfs.readFile('/proc/net/tcp', 'utf8');
tcp6 = await pfs.readFile('/proc/net/tcp6', 'utf8');
tcp = await fs.promises.readFile('/proc/net/tcp', 'utf8');
tcp6 = await fs.promises.readFile('/proc/net/tcp6', 'utf8');
} catch (e) {
// File reading error. No additional handling needed.
}
@@ -286,10 +286,10 @@ export class ExtHostTunnelService extends Disposable implements IExtHostTunnelSe
try {
const pid: number = Number(childName);
const childUri = resources.joinPath(URI.file('/proc'), childName);
const childStat = await pfs.stat(childUri.fsPath);
const childStat = await fs.promises.stat(childUri.fsPath);
if (childStat.isDirectory() && !isNaN(pid)) {
const cwd = await promisify(fs.readlink)(resources.joinPath(childUri, 'cwd').fsPath);
const cmd = await pfs.readFile(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8');
const cmd = await fs.promises.readFile(resources.joinPath(childUri, 'cmdline').fsPath, 'utf8');
processes.push({ pid, cwd, cmd });
}
} catch (e) {