filePharo支持home(~)作为路径的一部分吗



我试图在Pharo 8中使用相对于主目录(~/.ssh/id_rsa.pub(的路径,但它不起作用。例如:

'~/.ssh/id_rsa.pub' asFileReference exists    ==> false

并且路径是

'~/.ssh/id_rsa.pub' asPath      ==> "Path / 'home' / 'ubuntu' / 'stuff' / '~' / '.ssh' / 'id_rsa.pub'"

现在,在String>>asPath中,示例显示'~/Desktop' asPath,所以我猜这以前是受支持的,然后API被更改了。

如何从pharo中的'~/.ssh/id_rsa.pub'获得完整路径?

Pharo以FileLocator:的形式支持它

(FileLocator home / '.ssh' / 'id_rsa.pub') fullName "=> '/home/esteban/.ssh/id_rsa.pub'"

最新更新