flat assembler
Message board for the users of flat assembler.

Index > DOS > Recycle bin for DOS

Author
Thread Post new topic Reply to topic
bweller



Joined: 23 Sep 2004
Posts: 11
bweller
Does anyone know of a recycle bin for DOS, or if there is a way to do it with batch files?

Bill
Post 19 Jan 2005, 18:43
View user's profile Send private message Visit poster's website Yahoo Messenger Reply with quote
asmdemon



Joined: 18 Jan 2004
Posts: 97
Location: Virginia Beach, VA
asmdemon
you would have to rewrite the way COMMAND.COM handles the "del" command. instead of deleting the file have it move the file instead. the only problem is that "move", i think, is a seperate file so a batch and rewrite would have to be performed. is it possible, yes, but it would take a lot of work.

[edit] sorry, upon further research, i found that move is an internal command for dos version 6.0 and later. thus, a simple rewrite of the del command would probably be suffencient.[/edit]
Post 20 Jan 2005, 05:46
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid
you could rather install you own handler of DOS delete file function (on int 21h i think). I am sure command.com uses it too, and also all things like norton commander or DOS navigator don't use command.com to delete files i quess.
Post 20 Jan 2005, 21:11
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
why have something like a recycle bin in DOS?
first of all it sucks (i use shift+del in win), second if you make a misstake you can use "undelete"..
Post 21 Jan 2005, 07:27
View user's profile Send private message Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog
Doesn't DOS just rename a file instead of delete it when you delete it ?
I mean, in a DOS delete, the data is not destroyed & the record of the file in FAT? remains the same, the only thing that is changed is the first character of the basename? It's changed to a dollar $ or something isn't it?
AND if that's the case, a DOS program like undelete could be made & run. Something like a file manager, Norton Command type, that shows the undeleted files in a directory, or lists them on a dir tree thingie?
The only thing is that, once a DOS file is deleted/renamed it's data can be overwritten & there fore it is ruined.
Post 21 Jan 2005, 17:40
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
thats excatly what i mean by "undelete" (it already exists a program like that Bitdog, it comes with most DOS versions)...
the undelete programs shows the files even thou DOS has given it a nonvalid start character..
all deleted files gets a ? instead of the first char.
it's the same in Windows, only it does not have any "undelete" program.

/ Christoffer


Last edited by bubach on 13 Feb 2012, 15:42; edited 1 time in total
Post 22 Jan 2005, 13:33
View user's profile Send private message Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog
OK, so some one could write an INT 21h file handler proc that does not overwrite deleted files that are just renamed ?basename.ext
Then, a TSR program that is a file manager. (It could overwrite the INT 21h when it's loaded.) There are a few INT 21h file procs and maybe some more? like BIOS INT 13h or 25h, or Win98 INT 71h?.
Sounds a little complicated, but it's possible? Maybe an INT 21h hook
that checks for the proper function/subfunction in AH/AL = AX
then reroute IP to the new file handling trash bin proc. ????????
Well, it's just some thoughts anyway..........
Post 24 Jan 2005, 16:27
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
dos delete and windos delete changes the file's first character to deleted file signature, clusters used by file are freed up, so if you copy a file on the disk you have the chance to overwrite the deleted file's contents, if you start windos, it will probably mill all deleted files on your disk, because of the intensive swapping, undelete whould have a really little effectiveness in this case. under dos, if you immediately change your mind after deletion, you have great chance of succeccfully undeleting the files.

overall:
you might think twice before deleting a file - this is the best solution, and always back up everything valuable.
Post 03 Mar 2005, 16:16
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
It's been done before, so it's certainly possible. I even think there might be some source out there for doing it... and yes, "undelete" is not a good replacement, for the reasons Matrix mentioned.

Bubach: whether "recycle bin" sucks or not is up to each individual and his usage patterns, you can't make generalizations like that. I use shift+del in windows too 99% of the time, but when I don't, I am happy about recycle bin. And I'm sure a lot of "regular" users are happy about it too.
Post 03 Mar 2005, 16:22
View user's profile Send private message Visit poster's website Reply with quote
Torrey



Joined: 12 Oct 2003
Posts: 78
Torrey
bubach wrote:
thats excatly what i mean by "undelete" (it already exists a program like that Bitdog, it comes with most DOS versions)...
the undelete programs shows the files even thou DOS has given it a nonvalid start character..
all deleted files gets a ? instead of the first char.
it´s the same in Windows, only it does not have any "undelete" program.

/ Christoffer


DOS (fat file system) uses the character code 0xe5 to signify that the file has been deleted.
Post 17 Mar 2005, 10:46
View user's profile Send private message Visit poster's website Reply with quote
THEWizardGenius



Joined: 14 Jan 2005
Posts: 382
Location: California, USA
THEWizardGenius
? is what undelete shows as the first character, but 0xE5 is actually used. If you wanted your filename to start with 0xE5 (which is used in the Japanese character set) make 0x05 instead, and any programs should change it to 0xE5 instead. Yeah, I also use SHIFT-DEL in Windows, but it does the same thing as DOS DEL does- so I have been able to go into DOS and undelete things just the same (not in NTFS drives, of course). If you want to really delete a file, so nobody can get at it, you'll need to download a third-party program - of which many exist that are free.

_________________
FASM Rules!
OS Dev is fun!
Pepsi tastes nasty!
Some ants toot!
It's over!
Post 19 Mar 2005, 05:36
View user's profile Send private message AIM Address Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.