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

--datadir command line parameter doesn't handle space in path #128

Closed
leavion opened this issue Feb 14, 2017 · 6 comments
Closed

--datadir command line parameter doesn't handle space in path #128

leavion opened this issue Feb 14, 2017 · 6 comments

Comments

@leavion
Copy link

leavion commented Feb 14, 2017

Version

Version of Slic3r used goes here
1.33.3-prusa3d-linux64

Use About->About Slic3r for release versions

For -dev versions, use git describe --tag or get the hash value for the version you downloaded or git rev-parse HEAD

Operating system type + version

What OS are you using, and state any version #s
Ubuntu 16.04.2 LTS (xenial)

Behavior

  • Describe the problem
    The --datadir command line parameter doesn't handle spaces in path even when space is escaped or path is surrounded by quote signs.

  • Steps needed to reproduce the problem
    Run slic3r from the command line and pass a path to the datadir which has a space in it.

For example:

./slic3r --datadir '/home/me/3D Printing/slicer-beta/

  • If this is a command-line slicing issue, include the options used
  • Expected Results

Create or use the configuration files in the directory specified in the --datadir parameter and start.

  • Actual Results
    Displays an error:

Input file must have .stl, .obj or .amf(.xml) extension

  • Screenshots from Slic3r preview are preferred

Is this a new feature request?
No. It's a bug report.

STL/Config (.ZIP) where problem occurs

Upload a zipped copy of an STL and your config (File -> Export Config)

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 14, 2017

@leavion If you edit the slic3r shell script and add the --datadir parameter there, does it work?
I think the problem is in the script, which does not process the parameters with spaces correctly.
Thanks.

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 14, 2017

There seems to be two issues:

  1. The slic3r is a shell wrapper, calling perl slic3r.pl $@. Here $@ shall be quoted, but it is not.
  2. Slic3r only accepts a complete path, it shall understand a relative path or a path starting with ~/

@leavion
Copy link
Author

leavion commented Feb 14, 2017

Indeed, modifying the slic3r script and replacing $@ with "$@" seems to fix the issue.

I now was able to run this and it worked:

./slic3r --datadir '/home/me/3D Projects/xxx' "/home/me/3D Projects/Prusa/Original-Prusa-i3/Printed-Parts/stl/extruder-cover.stl"

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 14, 2017

Cool. I have updated the build script to produce a correct start script.
It would be great to make Slic3r recognize relative paths, but for now I think this is sufficient.
Closing, thanks.

@bubnikv bubnikv closed this as completed Feb 14, 2017
@leavion
Copy link
Author

leavion commented Feb 14, 2017

Actually, it will work with relative path and with ~ but you have to escape the spaces and not use quotes around the path to make it work.

For example this works fine once you have "$@" in the script:

./slic3r --datadir ../../3D\ Projects/xxx ../../3D\ Projects/Prusa/Original-Prusa-i3/Printed-Parts/stl/extruder-cover.st

as well as this one:

./slic3r --datadir ~/3D\ Projects/xxx ~/3D\ Projects/Prusa/Original-Prusa-i3/Printed-Parts/stl/extruder-cover.stl

@bubnikv
Copy link
Collaborator

bubnikv commented Feb 14, 2017

It will work with escapes, because with escapes the substitution is done by the shell. If you enclose a path into quotes, the substitution will not be done by the shell and it is left to the application. This was actually new to me as well.

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