Red Delete
GavinWraith (26) 1563 posts |
I may have brought this up before many years ago, but Andrew Rawnsley suggested that I bring it up again here. For many decades now, every time a new version of RISC OS comes up I find myself having to hack the Filer module so that the filer-object submenu (the one that appears when you move the pointer to the right over the second option down) has its Delete option in red. I find this useful, because deletion is dangerous, and the red for danger change of color helps the fingers avoid to avoid a potentially disastrous error. The hack is pretty trivial; a change of a single bit in the submenu data. It only needs doing once. Nevertheless, it would be nice if the data were read in from an editable text file. That surely would not be a difficult matter to implement. |
Steve Pampling (1551) 8170 posts |
I’m pretty sure I’ve brought this up before1 :) but if you run Fred Graute’s Transient with TrapDelete any accidental deletions end up in the recycle section of Transient and only if you use Shift-Delete do you actually delete. 1 Many times, possibly broken record level… |
John Sandgrounder (1650) 574 posts |
Alternatively, Making regular backups means that you can also get files back when you simply make a mess of them (as well as when you delete them). |
Steve Pampling (1551) 8170 posts |
Neither covers everything. Each has its place. As you probably recall I work in IT support, fortunately on the network and security side so I don’t get involved in conversations with users who expect the backup system to help them recover data created and then deleted between the nightly backups. Sometimes they are lucky and they did things where a recycle feature can bring things back |
Andrew McCarthy (3688) 605 posts |
I wonder how important these small things are to returning or new users? Probably more important than we think! As the idea of a recycle bin was on Acorn’s radar, evidenced by a prototype that surfaced on a Clan disc. Is there any source code hidden away in the archives that could be added to the source tree? |
Chris Johnson (125) 825 posts |
There is always the latest version of Transient by Fred Graute. This contains ‘TrapDelete’ which works very well, and is well worth trying. |
George T. Greenfield (154) 748 posts |
Don’t overlook either that Configure-Filer has a ‘Confirm’ tickbox and ‘all’ and ‘only deletes’ radio button options – I customarily set the latter ‘on’, which ensures I have to positively choose to proceed with a delete whether accidental or otherwise. But I appreciate that this does not save one from the ‘O my God what have I done’ moment seconds or minutes after insouciantly confirming a delete (we’ve all been there!). I must give Transient a try…. |
Steve Pampling (1551) 8170 posts |
For people used to other systems where recycle bins are just a fact the lack of that in the OS is a big surprise. I haven’t looked at the RISC OS Direct build, but if it doesn’t include Transient/TrapDelete then the author needs a wake up call. Chris’s comment about it being “well worth trying” barely scrapes the surface. If more people use it then any small deficiencies will surface and Fred can amend accordingly. I’d like to see it added to the standard OS build, I can’t see why anyone would argue otherwise. |
John Rickman (71) 646 posts |
I must give Transient a try You won’t regret it. |
Steve Pampling (1551) 8170 posts |
I suspect that if you “deleted” something on day 1 then you probably won’t recall what it was or even that you did the deletion by the time a couple of months have passed so 365 days is a certainty. Excluding directories that get a lot of transient file activity is useful (unless you want to really slow down a ROM build or similar. |
Chris Evans (457) 1614 posts |
IIRC most of the RISC OS ‘recycle’ programs I’ve tried in the past had a big draw back when it came to deleting ‘remote’ files or files on a second drive. They would try copying them to the local recycle bin/main drive! So say deleting an ISO image on another RISC OS computer would grind things to a halt. I can’t recall what happened with files being accessed with LanMan98! |
Steve Pampling (1551) 8170 posts |
As I said earlier:
While people avoid using a useful tool because of some possible difficulty they miss out on the known benefits and thorough testing of edge cases is delayed/slowed. Use it, report back. Turn unknown behaviour into known behaviour. |
Chris Evans (457) 1614 posts |
I was hoping that someone would reply that one of the programs did do what I’d like or had a work method that did. As there a number of programs PD and paid for it would seem foolish to spend time trying them when other people could easily tell me the results. Spare time is not something we have ‘in stock’. |
Steve Pampling (1551) 8170 posts |
It wasn’t just you I was encouraging to test things, more people more results.
Well, various people have different amounts of “spare time” for the next few months. It just occurred to me that the ideal situation is someone with work benches for the lab setup, a whole load of spare kit and some time not doing what they normally do because “social isolation” is now a good thing. More seriously – RO user age profile suggests we have a lot of vulnerable people. Stay safe, be healthy. —→ Aldershot content. |
Chris Hall (132) 3554 posts |
it just occurred to me that the ideal situation is someone with work benches for the lab setup, a whole load of spare kit and some time not doing what they normally do Yes. I seem to fit this description. |
Chris Johnson (125) 825 posts |
This is the case for all the bin utilities that I have come across.The bin has to be located somewhere. To some extent the same issue applies to the likes of !SyncDiscs. It has the advantage that it has its own scrap bin, the location of which can be set for each separate sync. I emphasise that the scrap location should always be on the secondary (backup) medium to prevent such copying. There is a problem if you are running Transient/TrapDelete and not using a scrap location in SyncDiscs. SyncDiscs will then simply delete unwanted objects. TrapDelete immediately grabs them, resulting in lots of copying. For this reason the development version on my HD at the moment (not in the current release version) has a user option to disable TrapDelete. This is done when SyncDiscs starts the actual sync process, and on completion, TrapDelete is reenabled. As far as a bin utility such as TrapDelete goes, one possible scenario would be for the bin path to be specified as e.g. $.Transient.Bin., but each time an object is deleted the head of the path up to the $ is checked, and the appropriate path constructed, so you would end up with Share::Name.$.rest of path. This would mean the bin for that object would be on the remote machine. However, this would not prevent copying back and forwards over the network if a copy/delete was used. However, if the object was moved by a rename, no copying would be needed. This is how SyncDiscs tries to do it. I believe TrapDelete also uses a rename as the first option when the deleted object is on the same medium as the bin. Not wishing to put words in Fred’s mouth, but perhaps a little elaboration on TrapDelete might be appropriate for those who have never tried it. It can be set up so that deletions are put in to a bin directory named by date, so each days bin is separate, and can be kept for a user specified period. In addition, the original path is retained, so that the object can be restored back to its original location if the deleted object needs to be recovered. The menu option ‘Restoration’ will produce a listing of all the objects in the bin with ‘local’ path and ‘original’ path shown. A simple selection of the object in the list and a click on the Restore button puts it back where it came from! Anyway – check it out. |
Steve Pampling (1551) 8170 posts |
That is why there is an option to ignore particular items (files, directories etc) Choices > Traps > “Pattern to Exclude”
This kind of thing is what I was talking about, people use, investigate and further development makes the utility even better.
Default I believe.
Hence John’s 365 expire period. |
Chris Johnson (125) 825 posts |
Well, yes, but you have to know which files to ignore beforehand 8) |
Rick Murray (539) 13840 posts |
I doubt that. Such functionality is common on desktop machines, but it simply doesn’t exist on mobile – it isn’t part of either Android or iOS. There may be add-ons, but as shipped, select something and tap on Delete and poof, it’s gone forever. And since (usually) neither of these systems grant you OS level privilege, nor have a removable storage media (and in some cases, use encrypted filesystems), your chance of recovering files by salvaging them from storage now marked as “free” is precisely zero. I reckon as the years advance, a growing number of people are going to be more familiar with the likes of Android than with Windows. |
Fred Graute (114) 645 posts |
Just to make sure – the original value of the TrapDelete_TrapDeletions system variable is restored (rather than just setting it to 1)?
Yes, a rename is tried first and if that fails a copy/delete is done. Actually there are 2 move operations, the first moves the deleted objects to an intermediate directory and the second moves the objects inside Transient’s bin directory. The reason for this is that objects are collected in day directories so there is change of name clashes. To prevent objects from being overwritten the second move will rename homonymous objects first. If each delete was given its own unique directory then this would not be necessary as no name clashes can occur and a single move would suffice. A trashcan application could be written in this way, which would also be better suited for deleting objects on remote systems as no renaming (and hence code) would be needed just a slave bin directory on each remote machine.
Hmm, I not sure it’s TrapDelete that needs elaboration but rather how to set up Transient for trapped deletions. TrapDelete ifself is just technical stuff that makes it all work. Anyone interested in that should download the latest Transient which has the source to TrapDelete included, along with a flowchart of how it works.
Objects that are copied/moved to Transient can be filtered into specific Users (directories) based on path, filetype and application they come from. All deleted objects (ie those coming from TrapDelete) can be filtered to a ‘bin’ directory, but one could also set up multiple bins for different types of object. A separate bin for images, BASIC files, applications, etc – it’s a pretty flexible system.
This also works for objects that have been dragged to Transient’s iconbar icon with Shift held down (ie a move rather than a copy), allowing objects to be ‘deleted’ by drag-and-drop. |
Chris Johnson (125) 825 posts |
Yes. The status of TrapDelete is checked when the job starts, and is only re-enabled at the end if it needed to be disabled. |
Frederick Bambrough (1372) 837 posts |
If I could sneak in a request for Transient… any chance of being able to reverse the display order of files in ‘Restoration’ to have latest first and to be able to select multiple files. I’ll butt out now. |
Fred Graute (114) 645 posts |
Done. Interface could be better but it works.
This is going to require a bit more thought. Which I’ll give it but I’m not making any promises. |
Frederick Bambrough (1372) 837 posts |
That’s cool. If I’ve changed my mind or forgotten to hold Delete on multiple objects it can be a pain to scroll down repeatedly. Guess what I did just before the request. |