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

File masks don't work on Windows #53

Closed
AlexeiA opened this issue Jun 16, 2020 · 7 comments
Closed

File masks don't work on Windows #53

AlexeiA opened this issue Jun 16, 2020 · 7 comments
Labels

Comments

@AlexeiA
Copy link

AlexeiA commented Jun 16, 2020

Given command from the examples:
> kepubify -o "converted" *.epub
Error: scan input "*.epub": CreateFile *.epub: The filename, directory name, or volume label syntax is incorrect.

@pgaskin
Copy link
Owner

pgaskin commented Jun 16, 2020

Type dir and see if there are actually epub files in the current directory. If not, then cd to it. If there are files but it still doesn't work, try using PowerShell instead.

@AlexeiA
Copy link
Author

AlexeiA commented Jun 16, 2020

The same error from PowerShell. By the way, if I try non-existing file name, the error is slighly different:
Error: scan input "1.epub": CreateFile 1.epub: The system cannot find the file specified.

@pgaskin
Copy link
Owner

pgaskin commented Jun 16, 2020

This might be because of the 4-character epub extension on Windows (meaning that wildcards don't work as expected) . As a workaround, you could convert the current dir (.) to ./converted (it will ignore the converted files).

Edit: it is.
Edit 2: Try *.epu*.

@AlexeiA
Copy link
Author

AlexeiA commented Jun 16, 2020

Yes, using directory instead of mask works, thanks! So this is not an issue for me anymore :)
Btw, when using mask the program returns error at line 55:
inputInfo, err := os.Stat(input)
Out of curiosity, does this line work on unix if input is "*.epub"?

@pgaskin
Copy link
Owner

pgaskin commented Jun 16, 2020

Yes, that works on everything but Windows.

You are correct that the error comes from there, but it's a red herring. The issue is because cmd doesn't expand it correctly (the wildcard processing is done by the shell).

Does *.epu* work?

@AlexeiA
Copy link
Author

AlexeiA commented Jun 17, 2020

Does .epu work?

No, cmd and PowerShell always pass wildcards as-is :(

@pgaskin
Copy link
Owner

pgaskin commented Jun 17, 2020

That's interesting. I wasn't aware of that before (I don't use Windows much right now). I might add wildcard handling directly if it's running on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants