72
73
async stat(resource: URI): Promise<IStat> {
75
>
const { stat, symbolicLink } = await SymlinkSupport.stat(this.toFilePath(resource)); // cannot use fs.stat() here to support links properly
76
>
77
>
let permissions: FilePermission | undefined = undefined;
78
>
if ((stat.mode & 0o200) === 0) {
79
permissions = FilePermission.Locked;
80
}
82
>
stat.mode & constants.S_IXUSR ||
83
stat.mode & constants.S_IXGRP ||
84
stat.mode & constants.S_IXOTH
86
permissions = (permissions ?? 0) | FilePermission.Executable;
87
}
89
>
return {
90
>
type: this.toType(stat, symbolicLink),
91
>
ctime: stat.birthtime.getTime(), // intentionally not using ctime here, we want the creation time
92
>
mtime: stat.mtime.getTime(),
93
>
size: stat.size,
94
>
permissions
95
>
};
96
>
} catch (error) {
97
throw this.toFileSystemProviderError(error);
98
}
100
101
private async statIgnoreError(resource: URI): Promise<IStat | undefined> {