Closed lesquoyb closed 1 year ago
I think it is more a problem of the "c:" and "d:", etc. than absolute or relative. There is no absolute root on Windows ? Maybe adding the correct protocol (like "file:") can help ?
To my knowledge, absolute paths on windows start with the drive letter, there's no "absolute root" like it's the case on linux/macos. Using a path made following the file protocol way gives me another error:
Unable to read input file file:///C|Users/lesqu/.eclipse/306334380_win32_win32_x86_64/configuration/org.eclipse.osgi/241/0/.cp/models/Tutorials/Predator Prey/models/Model 13.gaml. File not exist!
I tried all the variations possible for the path (different separators, escaping or not, quotes around or not etc.)
So I assume that you tried all the combinations specified here : https://stackoverflow.com/questions/5032424/how-can-i-specify-a-windows-drive-letter-when-using-subversion-svnssh ?
I also found other weird combinations : properties.put(Context.PROVIDER_URL,"file://\\d:\\tmp\\mycontext");
(here: https://stackoverflow.com/questions/3688132/how-can-i-specifiy-the-drive-letter-windows-for-the-provider-url-of-the-jndi-i)
Yes, though I realised I had another problem in my path with the spaces. So after some tweaking to get a model in a path without any space, turns out that using this protocol calls the Windows api to open the file with the default program associated with .gaml files (in my case gama GUI). And the script is still not able to read the path:
This behavior is normal. The gui version of GAMA tries to open/import the file you are mentioning (default action is "openFile") and discovers it is not part of a project. Why do you try to run it instead of the .bat
?
I didn't try to open it myself, that's what I've been trying to say, writing file:///...
in the command calls that behaviour.
What you see is only the result of the command at the first line in the command prompt.
Trying to neutralise it by surrounding it with double quotes only brings us back to the file not exist
stuff
Just in case, In msi.gama.headless, Application.java, line 576, if we change from createURI to createFileURI, it will recognize well the absolute path.
Relate to this issue https://github.com/gama-platform/gama/issues/3417 and commit https://github.com/gama-platform/gama/commit/bbd38c85b6d93f4f7afe712a44d788c533d77dde @RoiArthurB
But are we going to always have FileURIs to launch Gama Headless ? Shouldn't we enable the possibility, in case createFileURI
fails, to catch the Exception and try a simpler createURI
?
Describe the bug I have my gama installation on disk
D
and want to run a batch experiment from a file that is stored on myC
drive through headless, but when I run this command:It raises an error, and here is the corresponding log file content:
If I move the file to my
D
drive (the one from which I run the command) it still doesn't work if I give the absolute path:but if I change to a relative path, it finally works:
To Reproduce Steps to reproduce the behavior:
Expected behavior Absolute paths work as well as relative paths for batch experiments.
Additional context Headless legacy doesn't seem to have that problem: I can run the other experiment stored in that same file with headless legacy with these commands without any problem: