Describe the bug
When attempting to retrieve the stats of a dataset member that is not listed in the Zowe Explorer (ZE) dataset tree, the FileNotFound error is returned, even though the file exists.
However, if the dataset is added to the tree and its members are listed, the stats are correctly retrieved.
To Reproduce
I'm using following function that I execute as a VSCode command to call the stat function of the ZE FS provider.
public async testFSProviderStat() {
const treeFileUri = vscode.Uri.parse(
"zowe-ds:/zosmf/WORK.ASMMAC/TEST",
);
try {
const treeFileStats = await vscode.workspace.fs.stat(treeFileUri);
debug(
`File stats ${treeFileUri.toString()} ${JSON.stringify(treeFileStats)}`,
);
} catch (err) {
debug(
`File stats error ${treeFileUri.toString()} ${JSON.stringify(err)}`,
);
}
const notInTreeFileUri = vscode.Uri.parse("zowe-ds:/zosmf/SYS1.MACLIB/ABEND");
try {
const notInTreeStats = await vscode.workspace.fs.stat(notInTreeFileUri);
debug(
`File stats ${notInTreeFileUri.toString()} ${JSON.stringify(notInTreeStats)}`,
);
} catch (err) {
debug(
`File stats error ${notInTreeFileUri.toString()} ${JSON.stringify(err)}`,
);
}
}
- Open VSCode with empty ZE dataset tree
- Run the sample code that executes
vscode.workspace.fs.stat function
FileNotFound is thrown for both dataset members
- Add the
WORK.ASMMAC dataset to the ZE tree and list its members
- Run the test command again
- It returns stats for the
WORK.ASMMAC/TEST member, but still throws FileNotFound error for SYS1.MACLIB/ABEND
- Add
SYS1.MACLIB to the ZE Tree
- Run the command again
- Stats for both files are returned correctly.
Expected behavior
The stats for a dataset member should be retrievable even if the parent dataset is not listed in the ZE dataset tree. The FileNotFound error should not occur when querying existing files.
Screenshots
Desktop (please complete the following information):
- OS: MacOS
- Zowe Explorer Version: 3.1.2
- (Optional) Zowe CLI Version:
- (Optional) Are you using Secure Credential Store?
Additional context
Describe the bug
When attempting to retrieve the stats of a dataset member that is not listed in the Zowe Explorer (ZE) dataset tree, the
FileNotFounderror is returned, even though the file exists.However, if the dataset is added to the tree and its members are listed, the stats are correctly retrieved.
To Reproduce
I'm using following function that I execute as a VSCode command to call the
statfunction of the ZE FS provider.vscode.workspace.fs.statfunctionFileNotFoundis thrown for both dataset membersWORK.ASMMACdataset to the ZE tree and list its membersWORK.ASMMAC/TESTmember, but still throwsFileNotFounderror forSYS1.MACLIB/ABENDSYS1.MACLIBto the ZE TreeExpected behavior
The stats for a dataset member should be retrievable even if the parent dataset is not listed in the ZE dataset tree. The
FileNotFounderror should not occur when querying existing files.Screenshots
Desktop (please complete the following information):
Additional context