On Thu, Apr 20, 2017 at 09:21:01PM +0200, Nicolas Cellier wrote:
2017-04-20 9:53 GMT+02:00 Alistair Grant <akgrant0710@gmail.com>:
> What? Google this: man stat The first field of stat structure is > a device ID, so deciding if two files are on same file system or > not is doable by checking this field for the source file and > destination file (if it exists) or directory - modulo the fact > that you'd have to care of symbolic links with lstat.
I meant from within the image. Also, while this is fine for Linux, and probably for MacOS, what about Windows?
Ah, so it's more a Squeak/Pharo VM problem than a unix problem ;) You are right, there is a call to stat() in unix file plugin
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/pl...
but the device info is not passed back to the image... Too bad!
But it should be a straightforward extension. I think I'll ask on vm-dev if anyone objects to me adding this extension. Thanks for pointing this out! Cheers, Alistair
As for windows, it's not a problem, there is a rename function that would move files across devices (but not directories!) See rename() on msdn https://msdn.microsoft.com/en-us/library/zw5t957f.aspx