April 28, 2024, 10:09:53 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


A simple but dangerous cleanup program

Started by barry, November 29, 2006, 09:54:46 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

barry

This is based on the idea in the IBCleanUp program, which I thought was too complex a tool to do a simple job.

It's a simple non-console program (it doesn't bother to open even a console window) that simple and quickly deletes all files in the current directory only, that have tthe following extensions: .OPTS, .MAP, .A and .O when it's clicked on.ÂÃ,  It compiles to only 11k so it's nothing to keep copies in any project folders.

I made it as a simple tool for my own use.ÂÃ,  It should be tested to your comfort level before you use it.ÂÃ,  I'm a very rusty retired programmer and you shouldn't trust that I remember how to do any of this stuff.ÂÃ,  Well, trust but verify. :)


/*
EBClean
Made from the EBASIC example program READING_DIRECTORIES.EBA
Deletes all .OPTS, .MAP, .A and .O in the current diretory
*/

OPENCONSOLE
DEF dir,attrib:INT
DEF filename:STRING

dir = FINDOPEN(getstartpath+"*.*")
IF(dir)
ÂÃ,  ÂÃ,  DO
ÂÃ,  ÂÃ,  ÂÃ,  ÂÃ,  filename = FINDNEXT(dir,attrib)
IF attrib & (@FILE_NORMAL|@FILE_ARCHIVE) THEN
IF UCASE$(RIGHT$(filename, 4)) = ".MAP" then
DELETEFILE GETSTARTPATH+filename
ENDIF
IF UCASE$(RIGHT$(filename, 5)) = ".OPTS" then
DELETEFILE GETSTARTPATH+filename
ENDIF
IF UCASE$(RIGHT$(filename, 2)) = ".A" then
DELETEFILE GETSTARTPATH+filename
ENDIF
IF UCASE$(RIGHT$(filename, 2)) = ".O" then
DELETEFILE GETSTARTPATH+filename
ENDIF
/*
IF UCASE$(RIGHT$(filename, 4)) = ".EXE" then
DELETEFILE GETSTARTPATH+filename
ENDIF
*/
ENDIF
UNTIL filename = ""
ÂÃ,  ÂÃ,  FINDCLOSE dir
ENDIF

CLOSECONSOLE
END



Jerry Muelver

   IF UCASE$(RIGHT$(filename, 4)) = ".EXE" then
DELETEFILE GETSTARTPATH+filename

Aha! A file-deleting program that cleans up the evidence after it's done! Commented out in your code, but an interesting idea. You could rename the deleting program to .EXX as the first order of business, then name it back to .EXE after the job is done.

Or perhaps the IDE could use an option to delete these files (except the .EXE) after compiling?

barry

For my use I want to delete the .exe files but the old IBCleanUp program didn't so I commented it out in the posted version since that's what people are used to.

I figured anyone interested in this program would know how to uncomment it.

As a retired programmer I used to have to think in terms of protecting the user from himself but now I have the luxury of being irresponsible. :)

Barry

Jerry Muelver