pharo-launcher
pharo-launcher copied to clipboard
Renaming an image actually loses data if the image is open
What do you mean by loses data? The image is not copied to the right location or cannot be deleted?
Under which OS?
Windows 10. Loses means image trashed.
I tried. Indeed, you can loose data but I would say I expected to loose data. When you rename from the launcher interface, you rename files. If the image is still open, it refers to an image file that does not exists anymore. So any change to this image will be discarded. I think the good way to fix that is to disable renaming if an image is open.
@demarey how can you detect that the image is open? I think that listing the processes referencing the image could be a good way
@VincentBlondeau yes, it is the biggest issue. Find a cross-platform way to detect that an image is open. Did not yet have time to think about it
I just launched an image with PL that was already open. Luckily I saw some warning messages about not being able to create changes file, etc. For neophytes (or people who open lots of images), it would be good if PL could at least warn you before you run an image if it's already running.
I'm not sure cross-platform is possible, given the differences. But there is maybe a way that's not too dependent on the OS. You could see make a single method isRunning for an image path that would work its magic on each OS.
In Windows 10, there's a "Command line" Property for Pharo.exe that has the path to the image:
Maybe there's a way to fish it out using some OS calls? The info is there, at least in Windows.