colvars
colvars copied to clipboard
Offer some way for parser to deal with spaces in file paths
This is particularly relevant in Windows, where user directories often have spaces in them (maybe OSX as well?). Right now, a path with spaces (say in refPositionsFile) will be detected as several words and trigger an error.
Classic solutions to this are:
- escaping spaces
- double quotes
To me both options seem fine. Ideally we'd support both. But of course this is still more work for the parser to do.
Alternatively, using environment variables may be also useful in other scenarios. Something like this:
refPositionFile getenv(COMMON_DIR)/coordinates.xyz
which could be confined just to file path values. In principle I'm not against using variables for other values as well, it's just just more difficult to handle at that point.
The main reason why I'm not a big fan of quoting mechanisms specifically for this purpose is that their syntax differs depending on which shell you use (e.g. Bash or PowerShell).
Proposed solution: make the Dashboard detect spaces in paths it generates, and avoid them by making the paths relative, if possible.