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

Unable to use either the cli or programatically on MacOS #87

Open
TinoADev opened this issue May 8, 2018 · 3 comments
Open

Unable to use either the cli or programatically on MacOS #87

TinoADev opened this issue May 8, 2018 · 3 comments

Comments

@TinoADev
Copy link

TinoADev commented May 8, 2018

I get the following error when I try to use xsd2json:

Could not open resource database "/usr/local/bin/xsd2json": Inappropriate ioctl for device]

I noticed that the /usr/local/bin/xsd2json is a symlink to .../lib-pl/cli.exe and also saw the commit that talked about windows compatibility. Could this be the issue?

@fnogatz
Copy link
Owner

fnogatz commented May 9, 2018

The lib-pl/cli.exe is an SWI-Prolog saved state. For Linux, this is simply a file starting with the shebang #!/bin/sh:

> head -n5 cli.exe
#!/bin/sh
# SWI-Prolog saved state
exec ${SWIPL-/home/fnogatz/.swivm/versions/7.6.4/lib/swipl-7.6.4/bin/x86_64-linux/swipl} -x "$0" -- "$@"

<archive>

I would expect similar for MacOS. Could you provide the output for head -n5 cli.exe?

In the meantime, you can use xsd2json directly with SWI-Prolog by calling cli.pl:

> swipl -g main cli.pl -- --help
> swipl -g main cli.pl -- ../test/xsd/all_element2.xsd

@TinoADev
Copy link
Author

TinoADev commented May 9, 2018

Hey there, thx for the quick reply.

Here is the output:
#!/bin/sh \ \# SWI-Prolog saved state \ exec ${SWIPL-/usr/local/Cellar/swi-prolog/7.6.4/libexec/lib/swipl-7.6.4/bin/x86_64-darwin16.7.0/swipl} \-x "$0" -- "$@"\ \ <archive>

For my project I need to use xsd2json programatically, but thanks for the suggestion.

fnogatz added a commit that referenced this issue May 9, 2018
@fnogatz
Copy link
Owner

fnogatz commented May 9, 2018

I have added a noExe: true option for the node.js module in version v1.11.7 in order to use the native Prolog interface instead of the pre-compiled cli.exe. You can find the documentation here, and an example here.

Nevertheless, using the Prolog interface instead of the pre-compiled cli.exe has performance issues. But since I have no access to a MacOS machine, I am not able to fix the original issue...

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