Vanishing Status Icons when files edited

I've noticed that saving a file in some text editors makes the Status Icon assigned to the file vanish. For example, saving the file in Notepad keeps the Status Icon but doing the same in Sublime Text removes it. Atomic save (the method that saves a temporary copy and overwrites the original with it) is disabled in ST and fsutil file queryfileid also says that it's the same file, so I guess(?) the ADS should not be affected. Still, the Status Icon is removed upon saving. Any ideas why? Is there a way DOpus can preserve/restore it somehow?

It's nothing Opus can do anything about. If another program removes the metadata, you'll need to talk to the authors of that program.

The only thing Opus can do is store the labels in its config file, against the path, which is an option. But then they won't move with the file when it is moved or renamed.

1 Like

I'm doing that right now, I was just hoping if there was a way to keep that stuff in the file system instead of having DOpus to take care of it. It's exactly the issue of losing that info upon move/rename/copy that I'm worried about.

They probably just have to use the ReplaceFile API and it'll take care of preserving the ADS metadata for them.

Have you tried the "atomic save" to see what it does? It may actually turn out to use the ReplaceFile API that Leo mentioned, in which case the NTFS streams should be preserved.

2 Likes

The atomic save is a feature that ST does to reduce the chance of garbling the original file in case there's some problem saving the file. It works by saving the file contents to a temporary file and then renaming that file over/to the original file if the save succeeded and leaving it alone otherwise (thus preserving the original file). It is advised to keep it disabled as it tends to have other adverse side-effects as well, but it may come in handy for certain scenarios (I haven't run into one yet).

fsutil file queryfileid shows the file id changed when having atomic save enabled and I'd expect those metadata to be linked to the file id rather than its name, so I guess the way it operates would make retaining the ADS impossible.

But then again, those are all just my guesses. I know next to nothing about how these things work. Just to be on the safe side, I've tried enabling the feature and saving still butchered the ADS, so I might be on the mark there (quite possibly for the wrong reason, though).