![]() |
Forum Index : Microcontroller and PC projects : Maximite 2's MMEdit - How to put .BAK files in a separate folder
Author | Message | ||||
dvanaria Newbie ![]() Joined: 04/03/2018 Location: United StatesPosts: 15 |
Is there a system command/setting that will redirect all backup files that MMEdit creates into another folder? Or optionally, prevent .BAK files from being created? I'm finding that the .BAK files create a lot of clutter in my working directory. |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7938 |
Not as far as I know, but you can use the RENAME command to move your BAK files to a different directory if you wish. I can't currently test this, but it might work. I can't remember how the CMM2 handles wildcards. RENAME *.BAK AS backfiles/*.BAK If you like to live without a file safety net you can probably get rid of them with: KILL *.BAK But I wouldn't recommend it. I don't think there's a way of preventing them from being created - after all, it's a file safety device. :) Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
What version of MMEdit? Are you referring to *.bak files or files with a timestamp added to the *.bas file name? Jim VK7JH MMedit |
||||
Turbo46![]() Guru ![]() Joined: 24/12/2017 Location: AustraliaPosts: 1642 |
Are you thinking of the .bak files that the CMM2's editor creates? they tend to add uo. Bill Keep safe. Live long and prosper. |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I think you are right, he is talking about the CMM2 editor, nothing to do with MMEdit In that case, 'backup move OPTION EXPLICIT OPTION DEFAULT INTEGER DIM f$ f$ = DIR$("*.bak", FILE) DO WHILE f$ <> "" COPY f$ TO "/backup/"+f$ 'kill f$ PRINT f$ f$ = DIR$() LOOP You need to create a "backup" folder. There isn't a MOVE command so we have to COPY and DELETE I suggest you leave the KILL line remmed out until you are happy that the selected files are what you expect. Jim Edited 2022-11-14 09:36 by TassyJim VK7JH MMedit |
||||
dvanaria Newbie ![]() Joined: 04/03/2018 Location: United StatesPosts: 15 |
Thank you, that works well. I'll leave the KILL line remarked out. The backups have already saved me more than one time, so they are definitely good to have. Sorry for the confusion with the name of the editor, I thouht MMEdit was the name of the CMM2's editor. I didn't realize they are completely different programs. You're correct that I was just referring to the CMM2's editor. I'll try to correct the title of this forum post to reflect that. |
||||
thwill![]() Guru ![]() Joined: 16/09/2019 Location: United KingdomPosts: 4311 |
Hi Mick, Doesn't work, and nor does KILL *.BAK. AFAIK only LS/FILES performs any sort of globbing on the CMM2. Hi Jim, I don't have access to my CMM2 at the moment to confirm, but I believe you are mistaken and that RENAME will perform a MOVE. Best wishes, Tom Edited 2022-11-16 05:02 by thwill MMBasic for Linux, Game*Mite, CMM2 Welcome Tape, Creaky old text adventures |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
I am sure you are right. It should work but all I get is: Error in line 8: Access denied due to prohibited access I haven't investigated further. Jim VK7JH MMedit |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Found the problem with RENAME (in CMM2 V 5.0701) It doesn't like the double dots in the destination name. This works: 'backup move OPTION EXPLICIT OPTION DEFAULT INTEGER DIM f$, d$ f$ = DIR$("*.bak", FILE) DO WHILE f$ <> "" d$ = "A:/backup/"+LEFT$(f$,LEN(f$)-7)+"bak" PRINT f$+" >>> "+d$ RENAME f$ AS d$ f$ = DIR$() LOOP I don't think it needs the absolute path but not happy with ".BAS.BAK" even though it is OK when using COPY. Jim VK7JH MMedit |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |