Click to See Complete Forum and Search --> : Looking for a Temp - "cleaning" Macro


cangiante
06-07-2004, 07:48 AM
Every day I am in the need of converting quite a few M$ excel files I receive via email from the company I work for.

After nConverting all of them, and saving each one with a proper name, I end up with having several Epoc sheet copies of these files in the temp folder (see the attached image).

Is there anybody willing to help me in writing a correct procedure to clear all the files included into the TEMP folder?

To make just one example, one name is:

TMP0600B - Recuperati_Foglio1.$$$

I tried with the following macro, but I understand that it was not accurate:

PROC main:
WHILE key=0
IF EXIST("c:\system\temp\TMP.*")
DELETE "c:\system\temp\TMP.*"
ENDIF
IF EXIST("c:\system\temp\Mcrp.tmp")
DELETE "c:\system\temp\Mcrp.tmp"
ENDIF
ENDWH
STOP
ENDP

should anybody have any suggestions, PLS drop a line

cshandley
06-08-2004, 05:25 AM
Very easy! (I think;)

Try this macro:

PROC main:
TRAP DELETE "c:\system\temp\TMP.*"
TRAP DELETE "c:\system\temp\Mcrp.tmp"
ENDP

cangiante
06-08-2004, 12:45 PM
Ciao Chris!

Thanks very much for your kind help!

with slight modifications here it is...

PROC main:

TRAP DELETE "c:\system\temp\*.$$$"
TRAP DELETE "c:\system\temp\*.tmp"
ENDP

Hope that this may help others who are interested in
reducing digitations and improving personal productivity

fwaechter
06-08-2004, 03:22 PM
Hi Gianluca,

those files Mcrp**.tmp are created by Macro5 for the graphical display of your apps. If you delete them, they will be created new at every restart of Macro5.

Cheers
Fritz

cshandley
06-09-2004, 03:47 AM
If you want a nicer macro, try this:

PROC main:
LOCAL deleted%

IF DIR$("c:\system\temp\*.$$$") <> ""
TRAP DELETE "c:\system\temp\*.$$$"
deleted% = -1
ENDIF

IF DIR$("c:\system\temp\*.tmp") <> ""
TRAP DELETE "c:\system\temp\*.tmp"
deleted% = -1
ENDIF

IF deleted%
GetFocus:
ALERT("Deleted some temp files!")
ReleaseFocus:
ENDIF
ENDP


I have not tested it, but it should work...

cangiante
06-11-2004, 12:45 AM
thank you Fritz for your kind explaination!

thanks Chris for the nicer macro! it works very well!

wanman
06-11-2004, 06:03 AM
Alternatively you could try the attached little application which will do the same job and a little more. Unfortunately Vorbauer's website seems to be down at the mo, but I have attached the ER5 file to this post.

There are instructions on the following website and download options for both the ER5/ER3 versions (ok in Russian, but the downloads are the English versions).

http://www.mypsion.ru/software.php?aid=222

Regards

Si

cangiante
06-12-2004, 05:55 PM
Thanks Simon for your kind post. you reminded me I used to have a copy of CleanIt on my nB until my last spring cleaning up in which I probably made some good programs redundant ;-)

Anyway, I am trying to get more and more familiar with macros and that's why I am using Macro5 the more I can.

BTW, I wish I could thank also Korbinian Demmel from the Epoc Digest daily newsletter for submitting this macro of his:

Quote --- Quote --- Quote --- Quote --- Quote ---
____________________________________
Proc Main:
trap delete "c:\system\temp\TMP*.$$$"
EndP
-----------------------------------------------------------------

'trap' means, that no error is reported. For any reason 'exist("c:\system\temp\TMP*.$$$")' will always return FALSE. Perhaps 'exist' don't allow wildcards for any reason.
If you nevertheless want to check if their is any file to delete use:
___________________________________
Proc Main:
if dir$("c:\system\temp\TMP*.$$$")<>""
delete "c:\system\temp\TMP*.$$$"
endif
EndP
----------------------------------------------------------------

reagrds
Korbinian



PS: if you want to for example view each filename before deleting use:
_________________________________________
Proc Main:
local d$(255)

d$=dir$("c:\system\temp\TMP*.$$$")
While d$<>""
if alert("Delete this file?",d$,"Cancel","Ok")=2
delete d$
endif
d$=dir$("")
endWh
EndP
--------------------------------------------------------------------------

End of Quote --- End of Quote ---- End of Quote ---

Once again, thank you all for supporting this request of mine and have a very nice sunday!

fwaechter
06-12-2004, 10:55 PM
Sometime ago I've tried Cleanit, but I am looking for something else: Does anyone know a program, which can scan all system subfolders (as OpxScan does with *.opx files) - e.g. data, libs, opl, opm - and tell me, what is needed. I'm sure there is a lot of garbage on my machine, but I don't know what.

Fritz