Hi Ben, On 15 December 2017 at 22:14, Ben Coman <btc@openinworld.com> wrote:
On 16 December 2017 at 04:34, Cyril Ferlicot D. <cyril.ferlicot@gmail.com> wrote:
Le 15/12/2017 à 21:24, Hilaire a écrit :
In P3:
FileSystem disk workingDirectory =>File @ /home/hilaire/Travaux/Developpement/DrGeoII/Dev-pharo3.0/shared
In P7:
FileSystem disk workingDirectory =>File @ /home/hilaire
Is it a bug?
Hi!
In Pharo 3
workingDirectory = imageDirectory.
In Pharo 7
workingDirectory = directory from where Pharo was launched.
just double-checking... with equivalent shell commands... $ DIR1 = `pwd` $ $DIR2/pharo $DIR3/Pharo.image
Pharo 3 ==> workingDirectory = $DIR3 Pharo 7 ==> workingDirectory = $DIR1 ?
I wonder for such a semantic API change it might be good to introduce #workDirectory and deprecate #workingDirectory so the need for user-devs to change their code is more explicit. It might make easier to have an auto-conversion rule #workingDirectory ==> #imageDirectory, and make it harder to shoot yourself in the foot producing cross-platform libraries.
cheers -ben
I raised this concern when the change was first proposed. The only responses I saw were that it doesn't matter. Also, prior to Pharo 6, it was possible to change the working directory, so programs shouldn't have assumed that workingDirectory = imageDirectory.
Perhaps we should only refer to the operating system's current working directory. (Sorry I'm not in a position to dig into that right now)
Rajula wrote the code to allow the working directory to be updated, i.e. calling setwd(). I don't think it made it in to the submitted patch, but it obviously could be added in future. The working directory is cached (in DiskStore DefaultWorkingDirectory), but currently there is no way of changing the value, so effectively it is always the OS cwd. Cheers, Alistair