Skip to content

Commit

Permalink
Use the zos function
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Zeithaml <[email protected]>
  • Loading branch information
Martin-Zeithaml committed Nov 1, 2023
1 parent b31828d commit 46d7631
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/libs/zos-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import * as shell from './shell';
// Get file encoding from z/OS USS tagging
export function getFileEncoding(filePath: string): number|undefined {
//zos.changeTag(file, id)
let returnArray = os.stat(filePath);
if (!returnArray[1] && ((returnArray[0].mode & os.S_IFREG) == os.S_IFREG)) { //no error, and is file
let returnArray = zos.zstat(filePath);
if (!returnArray[1] && ((returnArray[0].mode & os.S_IFMT) == os.S_IFREG)) { //no error, and is file
return returnArray[0].ccsid;
} else {
common.printError(`getFileEncoding path=${filePath}, err=${returnArray[1]}`);
Expand Down

0 comments on commit 46d7631

Please sign in to comment.