Skip to content

fix: correctly construct default output filename for datasets and binary mode#32

Open
Ayush-AM wants to merge 1 commit into
openmainframeproject:masterfrom
Ayush-AM:fix/issue-22-output-filename
Open

fix: correctly construct default output filename for datasets and binary mode#32
Ayush-AM wants to merge 1 commit into
openmainframeproject:masterfrom
Ayush-AM:fix/issue-22-output-filename

Conversation

@Ayush-AM
Copy link
Copy Markdown

Fixes #22

Description of changes

This PR addresses the issue where the default output filename was poorly constructed when providing a z/OS dataset name (e.g., //'my.data.set') and didn't correctly use the .bin extension in binary mode.

Key updates

  • Binary Mode Support: Both the Java and C++ implementations now correctly default to a .bin extension when the -b (binary) flag is used, rather than requiring manual output specification or defaulting to .txt.
  • Dataset Name Cleanup: If the input filename is a dataset path starting with // and/or enclosed in single quotes ' ' (e.g., //'my.data.set'), the tool now strips the slashes and quotes before appending the appropriate extension. This results in a clean output filename like my.data.set.bin or my.data.set.txt.
  • Help Text Update: Updated the CLI usage/help text in both implementations to clarify this default filename behavior.

Testing Performed

  • Built and compiled both the Java and C++ versions.
  • Verified that running java -jar target/tersedecompress.jar -b "//'my.data.set'" correctly attempts to output to a sanitized file named my.data.set.bin.

@Ayush-AM Ayush-AM force-pushed the fix/issue-22-output-filename branch from 0561ceb to 28268e0 Compare May 20, 2026 06:36
Signed-off-by: Ayush Mahajan <140263932+Ayush-AM@users.noreply.github.com>
@Ayush-AM Ayush-AM force-pushed the fix/issue-22-output-filename branch from 28268e0 to 25e0a06 Compare May 20, 2026 06:49
@Ayush-AM
Copy link
Copy Markdown
Author

Hi @alexgubanow,

I've opened this PR to resolve issue #22 regarding the output filename generation.

Here is a summary of the fixes implemented for both the Java and C++ versions:

  • Binary Mode: When the -b flag is passed, the default output file now correctly uses a .bin extension instead of erroring out or defaulting to .txt.
  • Dataset Path Cleanup: If an input dataset name is provided (e.g., //'my.data.set'), the logic now strips the leading // and surrounding single quotes (') before appending the default extension. This results in a much cleaner filename (like my.data.set.bin).
  • Help Text: Updated the CLI usage text to reflect these defaults.

(Note: There was a brief issue with the DCO check due to a branch sync mismatch, but I have rebased the PR against master and the branch is now clean with a single signed-off commit).

Please let me know if everything looks good or if any further adjustments are needed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The output filename constructed badly, when input is dataset path

1 participant