Closed juliendelplanque closed 6 years ago
This is actually a bug. The example above shows more ../ segments than are being utilized when navigating to the directory that is displayed. If you evaluate the file path that is returned from the dialog, you are several levels "up" from /, and the file can't be opened.
Thanks for the report, apparently Pharo 7 changed how asFileReference
works and instead added canonicalize
.
Thanks for the fix. But ..
is more complicated than I realized. I have a symlink
/Users/black/graceProgs -> /Users/black/Andrew Black/technical/Grace/sample code/
So in Darwin, at least, /Users/black/graceProgs/..
is /Users/black/
, while /Users/black/Andrew Black/technical/Grace/sample code/..
is /Users/black/Andrew Black/technical/Grace/
. But when one looks at /Users/black/graceProgs/
and /Users/black/Andrew Black/technical/Grace/sample code/
with FileDialog one sees the same directory, and clicking the ..
icon takes one to the same place ... which seems entirely reasonable. It's just not the behavior of Darwin.
I've no idea if other Unixes do this too — canonicalizing the pathname before doing the lookup, rather than just following the path that at the user provides.
Maybe the file reference used internally should be resolved before displaying it?