Closed hqnghi88 closed 6 years ago
The title of the issue is misleading. Absolute file names work perfectly (eg, I tried something like file shape_file_buildings <- shape_file('/Users/drogoul/Documents/Git/gama/msi.gama.models/models/Features/3D Visualization/includes/building.shp', 0);
and it opened without problems). Only the ones prefixed by a protocol are not yet accepted. This effectively relates to gama-platform/gama2#14 so I close this issue.
Sorry, i dont want to mislead , i forget to remove the file:// (protocol) . Actually , on windows, i cant make it work with absolute path, file parcels_shapefile <- file("C:/Users/hqngh/OneDrive/Gama1.7/JTD_2017/includes/binhthanh_village_scale/parcels_binhthanh_village.shp"); nor file parcels_shapefile <- file("C://Users//hqngh//OneDrive//Gama1.7//JTD_2017//includes//binhthanh_village_scale//parcels_binhthanh_village.shp");
I tried ubuntu and it work as same as your unix.
and this also dont work file parcels_shapefile <- file("C:\Users\hqngh\OneDrive\Gama1.7\JTD_2017\includes\binhthanh_village_scale\parcels_binhthanh_village.shp");
neither adding ,0 as in your example file parcels_shapefile <- shape_file("C:/Users/hqngh/OneDrive/Gama1.7/JTD_2017/includes/binhthanh_village_scale/parcels_binhthanh_village.shp",0);
I've made a small modification (using the new Paths API from Java 7 or 8) that seems to work in both macOS and Windows. Can you check the commit once it has been made ?
It works. But i cant Open Declaration from right click, or F3, to open an absolute declared file. Do we consider it as an issue or documente it , may be it relate to some priviledge on win os?
Can you try with the latest commit ?
It works. Thank you very much.
Steps to reproduce
1. Try to declare a file withe abslute path, like: file parcels_shapefile <- file("file:\D:\Downloads\AWP2018\binhthanh_village_scale\parcels_binhthanh_village.shp");
2. Launch simulation 3.
Expected behavior
NO exception and file read. It should relate with gama-platform/gama2#14 once we can use prefix for any file outside of gama project (file://, platform://, url://)
Actual behavior
Exception: File denoted.....
System and version
Gama git