mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
better fix for #44543
This commit is contained in:
parent
1a8ff9edff
commit
4d6291cd4a
|
@ -43,7 +43,12 @@ export function readdir(path: string, callback: (error: Error, files: string[])
|
|||
return fs.readdir(path, callback);
|
||||
}
|
||||
|
||||
export function statLink(path: string, callback: (error: Error, statAndIsLink: { stat: fs.Stats, isSymbolicLink: boolean }) => void): void {
|
||||
export interface IStatAndLink {
|
||||
stat: fs.Stats;
|
||||
isSymbolicLink: boolean;
|
||||
}
|
||||
|
||||
export function statLink(path: string, callback: (error: Error, statAndIsLink: IStatAndLink) => void): void {
|
||||
fs.lstat(path, (error, stat) => {
|
||||
if (error) {
|
||||
return callback(error, null);
|
||||
|
|
|
@ -42,7 +42,7 @@ import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/
|
|||
import { getBaseLabel } from 'vs/base/common/labels';
|
||||
import { assign } from 'vs/base/common/objects';
|
||||
import { Readable } from 'stream';
|
||||
import { IWriteFileOptions } from 'vs/base/node/extfs';
|
||||
import { IWriteFileOptions, IStatAndLink } from 'vs/base/node/extfs';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
|
||||
export interface IEncodingOverride {
|
||||
|
@ -1233,18 +1233,12 @@ export class StatResolver {
|
|||
},
|
||||
|
||||
function stat(this: any): void {
|
||||
extfs.statLink(fileResource.fsPath, (error: Error, statAndIsLink) => {
|
||||
if (error) {
|
||||
return this(error, null);
|
||||
}
|
||||
|
||||
isSymbolicLink = statAndIsLink.isSymbolicLink;
|
||||
this(null, statAndIsLink.stat);
|
||||
});
|
||||
extfs.statLink(fileResource.fsPath, this);
|
||||
},
|
||||
|
||||
function countChildren(this: any, fsstat: fs.Stats): void {
|
||||
fileStat = fsstat;
|
||||
function countChildren(this: any, statAndLink: IStatAndLink): void {
|
||||
fileStat = statAndLink.stat;
|
||||
isSymbolicLink = statAndLink.isSymbolicLink;
|
||||
|
||||
if (fileStat.isDirectory()) {
|
||||
extfs.readdir(fileResource.fsPath, (error, result) => {
|
||||
|
|
Loading…
Reference in a new issue