good morning folks!
Going through some of the things that are marked as deprecated just by way of cleanup before I have to do it in a panic someday when it gets removed.
What Ive considered the appropriate way to rewrite important files is to write to a temporary file and then do a file system swap of the 2. Then you can validate the new file exists and didnt get messed up due to disk space or other issues before you delete the original one.
In order to do a file swap, or even just a move to the new appropriate location, the temporary file has to be on the same physical volume as the one youre working on. I used to be able to get a reference to the temporary folder on the same volume as the file I was working with via the folderItem.temporaryFolder method. This is deprecated now and Im supposed to use the SpecialFolder object or the GetTemporaryFolderitem method? As far as I can see those will only provide me with a temporary file on the boot volume. What if I need a temporary file on some other volume in order to do that swap or move?
As a work around Im just creating a properly named temporary file in the same parent folder as the file I am working with. Is this the new standard way of doing this? Or have I misunderstood the being on the same volume requirement for swapping files? Or should there be a feature request for this?