Hi all,
Manuel Leuenberger and I ran into an issue with the
FileReference>>#moveTo: method last week. On my system, I have "/" and
"/home" in two different partitions/file systems. If I do something like
the following, Pharo complains with a PrimitiveFailed signal:
'/tmp/aFile.txt' asFileReference moveTo: '/home/claudio/aFile.txt'
asFileReference
I do not know how this is implemented exactly, but assume that the
"rename" syscall is used (on Linux systems, that is), which does not
work across file systems. The issue does not arise if I moveTo: inside
the same filesystem.
Is this expected behaviour? It is not obvious (to me) that
FileReference>>#moveTo: requires source and target to be on the same
filesystem. It would therefore make more sense to me if there were a
fallback that copies and deletes if two filesystems are involved (much
like "mv" behaves).
What do you think?
Cheers,
Claudio