Safe overwrite

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
binocular222
Posts: 1423
Joined: 04 Nov 2008 05:35
Location: Win11, Win10, 100% Scaling

Safe overwrite

Post by binocular222 »

I notice sometimes, there's a backup file for overwrite operations (specifically some Microsoft Office files), sometimes, not. My question is:
- It's genereated by XY or by Windows or by Microsoft Office?
- When it's created? Is it self-destroyed after the overwrite operation is success?
- Today, I made a disaster when I overwrite a wrong files, thus destroy my whole work. The problem is: for most file operations (copy, move, rename, delete) I can undo, or even use recovery software in-case hard-delete, but for overwrite, all recovery softwares fail, no cure. I'm thinking of a "safe-overwrite" script which back-up specific file types on overwrite (rename to ~<base>.<ext> then set as hidden), but there's no Custom-Event-Action to detect whether I press "overwite". Any work around? May I suggest adding action "run specific sript" to Custom Copy - Name Collision dialog?
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Safe overwrite

Post by bdeshi »

binocular222 wrote:May I suggest adding action "run specific sript" to Custom Copy - Name Collision dialog?
Why not ask for complete CEA implementation?
(We all need that, the more votes for it the better. :wink: )
======
binocular222 wrote:- It's genereated by XY or by Windows or by Microsoft Office?
XYcopy creates a copy of the overwrite target as "~SafeOverwrite.tmp" before beginning the overwrite, and it's deleted immediately after the operation is complete.

AFAIK, MSOffice generate tmp filenames have a few more symbols.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Filehero
Posts: 2732
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Safe overwrite

Post by Filehero »

I need to resurrect this thread.

Any Atom.io users around here?

I do use Custom Copy with Safe Overwrite by default (also during scripting, because it cannot be changed/deactivated there). When this way a file opened in Atom is overwritten, the name of the open file is suddenly changed to "~SafeOverwrite.tmp" (including a dirty flag). Since this is not happening with Notepad++, Atom might have implemented a Custom Copy detector by accident. :twisted:

Any explanation why one editor is getting the Custom Copy temporary file name?
before_custom-copy.png
after_custom-copy.png

FH
To see the attached files, you need to log into the forum.

Filehero
Posts: 2732
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Safe overwrite

Post by Filehero »

@Don, is there a way to add a switch/flag for "Save Overwrite" to SC copyto (and their siblings)?

With my (rather small) source code files I could life without Safe Overwrite, but when script-wise syncing/editing my libraries across machines and SVN I cannot do without the state-of-the-art Name Collision dialog. :)

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: Safe overwrite

Post by bdeshi »

Filehero wrote:Any Atom.io users around here?

I do use Custom Copy with Safe Overwrite by default (also during scripting, because it cannot be changed/deactivated there). When this way a file opened in Atom is overwritten, the name of the open file is suddenly changed to "~SafeOverwrite.tmp" (including a dirty flag). Since this is not happening with Notepad++, Atom might have implemented a Custom Copy detector by accident. :twisted:
Not an Atom text editor user, but it sounds like Atom detects file renames on-the-fly! Potentially both a useful and unwanted feature. :kidding: Perhaps this can be disabled in Atom config? (if you want that)
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

Filehero
Posts: 2732
Joined: 27 Feb 2012 18:50
Location: Windows 11@100%

Re: Safe overwrite

Post by Filehero »

SammaySarkar wrote:Perhaps this can be disabled in Atom config? (if you want that)
No, I even checked the config at the sub-pixel level.

Since manually reloading the affected files each time is no real option, I might have to skip Custom Copy then. I can't give up Atom after I've made me a nice syntax highlighting.

Post Reply