Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mrbobdobolina

macrumors member
Original poster
Feb 28, 2016
81
57
*sigh*... okay. First off: I'm sorry.

Secondly, I don't expect anyone will be able to solve this issue... what I really am looking for are ideas on *why* this *might* happen...

Here's the issue:

In Photoshop (2020 and 2021) on Catalina and Big Sur, if you have a photoshop document that contains layers and you choose to "Save As..." a filetype that doesn't support layers AND you are overwriting a file that already exists, Photoshop will ask if you want to overwrite the file, but instead it will save the file as a new file, appending " copy" to the filename.

Example: Make a poster for an event. Have 3 layers of text. Save as a jpg. Show your friend, he says the time is wrong. Open the psd, change the time. Use "Save As..." to save the file as a jpg. Give it the same name. Photoshop asks if you want to overwrite the file. Choose the overwrite option. You now have two jpg files: "party poster.jpg" and "party poster copy.jpg" It does not overwrite the file it told you it was going to overwrite.

BUT Here's the kicker:

If you repeat this process but choose to overwrite the file "party poster copy.jpg" it WILL overwrite the file.

Also, if you flatten the file before choosing "Save As..." the save feature works the way you expect it to. It'll overwrite the file when it says it's going to.

Adobe claims they are "working on a fix for the issue with Apple" but this has been going on for over a year.

I don't know all the ins and outs of the new features and securities of the operating systems, but could this really be a Catalina issue? I'd just like to understand a little more from the programming side why something like this could happen.

And... again, I'm sorry. I know this is a very niche issue that involves two very large tech companies that are not always very open about what is happening behind the scenes.

I appreciate your thoughts.
 

velocityg4

macrumors 604
Dec 19, 2004
7,330
4,724
Georgia
Sounds like you have an open file and are trying to overwrite it with your save as command. You can't do that because the file is open. Same thing if you have it open and tried to delete it while open.
 
  • Like
Reactions: mrbobdobolina

casperes1996

macrumors 604
Jan 26, 2014
7,593
5,764
Horsens, Denmark
Sounds like you have an open file and are trying to overwrite it with your save as command. You can't do that because the file is open. Same thing if you have it open and tried to delete it while open.

Yep. What Adobe could do if they want to permit this behaviour is write the data on disk as a new file, close the open file descriptor, delete the file then move the new file to take the old ohe’s name and place
 
  • Like
Reactions: mrbobdobolina

mrbobdobolina

macrumors member
Original poster
Feb 28, 2016
81
57
Yep. What Adobe could do if they want to permit this behaviour is write the data on disk as a new file, close the open file descriptor, delete the file then move the new file to take the old one’s name and place
Ooohh that's interesting... so is that how "replace file" typically works in a save dialog? And the program would handle the "overwriting" (not the OS)?
 
Last edited:

casperes1996

macrumors 604
Jan 26, 2014
7,593
5,764
Horsens, Denmark
Ooohh that's interesting... so is that how "replace file" typically works in a save dialog? And the program would handle the "overwriting" (not the OS)?
Depends how you write things, I'm fairly certain the OS can do this for you (now I'm actually forgetting how all my prior code works on the spot, haha), but no matter if the OS or program explicitly does it, it's basically the same trick to ensure atomicity.
Let's say you wiped the old file without first writing the new data to disk; If there was. a power-cut or crash before the new data could be written it would all be gone. But if you write the new data, then delete the old data and then move it over, there's no state the system can be in where all data is gone
 
  • Like
Reactions: mrbobdobolina
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.