dosbox-staging icon indicating copy to clipboard operation
dosbox-staging copied to clipboard

Support directories in DELETE command

Open NicknineTheEagle opened this issue 2 years ago • 6 comments

Are you using the latest Dosbox-Staging Version?

  • [X] I have checked releases and am using the latest release.

Different version than latest?

No response

What Operating System are you using?

None

If Other OS, please describe

No response

Is your feature request related to a problem? Please describe.

Under real MS-DOS (and Windows) command prompt, using DELETE command on a directory deletes all files inside that directory non-recursively and leaves the directory itself intact (same as going into that directory and running del *.*). Dosbox is missing that feature, directories are simply skipped. It might be necessary for some batch scripts.

Describe the solution you'd like

Check if a directory is passed in DELETE command (no wildcards), if yes, iterate over all files inside that directory and delete them.

Describe alternatives you've considered

No response

Add any other context or screenshots about the feature request here.

No response

Code of Conduct & Contributing Guidelines

  • [X] Yes, I agree.

NicknineTheEagle avatar Feb 10 '23 23:02 NicknineTheEagle

DOSbox-X supports that, so maybe code can be picked up from there.

Torinde avatar Feb 11 '23 14:02 Torinde

DOSbox-X supports that, so maybe code can be picked up from there.

I've looked at Dosbox-X DELETE command and its code is pretty convoluted, to say the least. Probably better to just write our own implementation.

NicknineTheEagle avatar Feb 11 '23 20:02 NicknineTheEagle

@kcgen We have DEL to delete files, DELTREE to delete folders. No game/app is named that needs this functionality. I think this is safe to close.

Burrito78 avatar May 13 '23 20:05 Burrito78

I'd leave this open with a low priority. This could break batch scripts. I'm thinking of non-gaming scenarios, e.g. using batch scripts for dev work to clean and rebuild a project, etc.

johnnovak avatar May 13 '23 21:05 johnnovak

Should this issue also be referencing #2956, which also picks up rework of the commandline framework?

japsmits avatar Feb 06 '24 14:02 japsmits

Should this issue also be referencing #2956, which also picks up rework of the commandline framework?

Yep, seems related. It's referenced now that you mentioned it :)

johnnovak avatar Feb 06 '24 22:02 johnnovak