* ancestor is followed even for files that are about to be created.
*/
async function resolveRealPathForNonexistent(resource: URI, realpath: (fsPath: string) => Promise<string>): Promise<URI> {
sessionPermissions.ts
const fsPath = resource.fsPath;
try {
return URI.file(await realpath(fsPath));
} catch (e) {
if ((e as NodeJS.ErrnoException).code !== 'ENOENT') {
throw e;
}
const tail: string[] = [path.basename(fsPath)];