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

invalid argument or permission denied on Windows with specific paths #3789

Closed
GiantCrocodile opened this issue Jul 8, 2017 · 4 comments
Closed

Comments

@GiantCrocodile
Copy link

GiantCrocodile commented Jul 8, 2017

I'm not sure if this is a bug but I saw that if I do this:

pandoc -f html -o bla.pdf ./

I get an pandoc: ./: openBinaryFile: permission denied (Permission denied) error. If I do this:

pandoc -f html -o bla.pdf *.md or pandoc -f html -o bla.pdf ".*.md" or pandoc -f html -o bla.pdf .*.md or pandoc -f html -o bla.pdf *.md I get an

pandoc: .*.md: openBinaryFile: invalid argument (Invalid argument)

Not sure this is a specific Windows platform issue. What I tried or expected: Specify whole directory as source or to include all files with specific ending (md) as source. I'm sorry if this is expected behavior!

This happens with latest nightly.

@GiantCrocodile GiantCrocodile changed the title invalid argument or permission denied on Windows with specific path invalid argument or permission denied on Windows with specific paths Jul 8, 2017
@mb21
Copy link
Collaborator

mb21 commented Jul 8, 2017

AFAIK this is expected behaviour on Windows since the wildcard is specific to unix bash. See:

@GiantCrocodile
Copy link
Author

Thanks for linking this @mb21. I didn't found that. So the current solution for Win users is Ryan Gray's way?

@echo off
:: Pandoc wrapper for calling it with wildcard file parameters.
:: Expands any arguments containing wildcards according to standard
:: Windows CMD.exe conventions.
setlocal EnableDelayedExpansion
set pandoc_cmd=pandoc
for %%I in (%*) do set pandoc_cmd=!pandoc_cmd! "%%~I"
!pandoc_cmd!
endlocal

@mb21
Copy link
Collaborator

mb21 commented Jul 8, 2017

Yes, pretty sure jgm's comment there still applies:

Yes, on second thought I'm just going to revert that commit

e.g. https://github.com/jgm/pandoc/search?q=globbing+windows&type=Commits

@le-dawg
Copy link

le-dawg commented Jul 16, 2019

Thanks for linking this @mb21. I didn't found that. So the current solution for Win users is Ryan Gray's way?

@echo off
:: Pandoc wrapper for calling it with wildcard file parameters.
:: Expands any arguments containing wildcards according to standard
:: Windows CMD.exe conventions.
setlocal EnableDelayedExpansion
set pandoc_cmd=pandoc
for %%I in (%*) do set pandoc_cmd=!pandoc_cmd! "%%~I"
!pandoc_cmd!
endlocal

How do I use this correctly ? My makefile has the unexpanded wildcards and i call pandoc from there.
I.e.
make pdf
-> makefile:
pandoc "$(INPUTDIR)"/*.md \
-o "$(OUTPUTDIR)/$(STDNO)-$(FIRST)$(LAST)-

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

3 participants