Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-d switch doesn't work without -p #2

Open
iammer opened this issue Nov 17, 2016 · 2 comments
Open

-d switch doesn't work without -p #2

iammer opened this issue Nov 17, 2016 · 2 comments

Comments

@iammer
Copy link

iammer commented Nov 17, 2016

If I run:
zfec -d dest_path /path/to/some-file
the output files are created in /path/to/ instead of dest_path. However if I run:
zfec -d dest_path -p some_prefix /path/to/some_file
it works correctly.

Is the path to the source file included as the prefix by default? Is this expected behavior?

@warner
Copy link
Member

warner commented Feb 4, 2018

Testing this now (in 1.5.0), zfec -d dest_path subdir/README.rst fails because the command doesn't create the -d directory automatically (it throws an exception that reads No such file or directory: 'dest_path/README.rst.0_8.fec'). Creating the directory first, it still fails because it tries to use the whole source path as a prefix (No such file or directory: 'dest_path/subdir/README.rst.0_8.fec'). I'm guessing that the behavior you saw was because your dest_path overlapped with some part of your /path/to/some-file.

I think a better behavior would be to use just the basename of the supplied file as the default prefix. So mkdir dest_path; zfec -d dest_path subdir/README.rst should create dest_path/README.rst.0_8.fec / etc.

I'll add a patch with that change.. I'm going to assume that it'll fix this issue, but if not, please feel free to re-open. THanks!

@warner
Copy link
Member

warner commented Feb 5, 2018

Ah, although, zfec subdir/README.rst should probably create the *.fec files in subdir/, not in the current directory. So if we omit -d, we should use the full path of the input file as the prefix, but if we provide -d, we should use its basename.

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

No branches or pull requests

2 participants