Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Picomite [Tool] SFA - Simple File Archiver
Author | Message | ||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
I have dozens of files on my Pico's flash memory and needed a backup of them on my PC with XModem. Since Epsilon's remarkable MAR didn't work for the Pico for me, I wrote a simple archive program. It creates one single file from the many files in the active directory, which can then be easily transferred to the PC. On the PC, the individual files can be extracted with a text editor (e.g. Notepad++). Later, this will be done by a separate program. Unfortunately, I found two bugs in the Picomite firmware that took me a few hours to work around. The first bug concerns the "DIR()" function, which seems to be affected by an "OPEN fname$ ...". This does not happen on the CMM2. I've written two bypass subroutines (ArchiveFiles_0 + ArchiveFiles_1) that work, but neither fully satisfy. The bug is demonstrated in the "ArchiveFiles_2" subprogram. The second bug is related to the "Print#" command. It creates e.g. from >Print #1, "0.bas"< ---- >.bas<. So it omits the zero. This is not good. Here, too, the MMBasic for CMM2 works without any complaints. My workaround for this bug is: Print #1,"%&"+"0.bas"+"&%". Demo: Open "testprint.txt" For output As #1 Print #1,"%&"+"0.bas"+"&%" Print #1,"0.bas" Close #1 sfa.zip When the bugs are fixed I will upload a revised version. Regards Michael causality ≠ correlation ≠ coincidence |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9112 |
no issue for me The second issue may be a limitation of LittleFS. Do you see the same thing if you run your program on the SDcard which is then the same as CMM2? PS: Why not connect an SDcard and just use COPY "*.*" to "B:/backupdir |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
Hi Peter, that's weird! Open "testprint.txt" For output As #1 Print #1,"%&"+"0.bas"+"&%" Print #1,"0.bas" Print #1,"%&"+"1.bas"+"&%" Print #1,"1.bas" Close #1 I get this with edit: .bas %&1.bas&% 1 .bas > list"testprint.txt" %&0.bas&% 0.bas %&1.bas&% 1.bas With Notepad++ (Windows) At the moment I have no way of connecting an SD card. I just wanted you to be informed. There is a workaround, but it's not very elegant. Thanks for looking at this issue! Best regards Michael causality ≠ correlation ≠ coincidence |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9112 |
Your notepad version has been transferred with Xmodem from it loaded as a program Use XMODEM S "testprint.txt" and it should be the same as LIST The problem is that when you load it and edit it the file is tokenised with undefined results LIST just prints the ascii so is correct Edited 2023-03-02 02:25 by matherp |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
Use XMODEM S "testprint.txt" and it should be the same as LIST The problem is that when you load it and edit it the file is tokenised with undefined results LIST just prints the ascii so is correct Hi Peter, your assumption is correct. It's not a bug. Sorry! Learned something again ... EDIT: Another observation (already mentioned in the first post): The editor of MMBasic for CMM2 behaves differently to Picomite and displays file contents correctly. Edited 2023-03-02 03:18 by twofingers causality ≠ correlation ≠ coincidence |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
This is the New Simple Archiver: nsa.zip A useful tool for me to back up files, help with transfers and save disk space, although it doesn't compress the files. It is partially compatible with Epsilons@TBS "MAR " archiver: Regards Michael causality ≠ correlation ≠ coincidence |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
There have been changes to the firmware for the PicoMite. That's why I revised the archiver software. The result is NSA V1.0 , tested with Picomite V5.09, MMB4W 5.07.03.24 and CMM2 5.07.00. I found out that on the CMM2 the LOC() - proof: testloc.zip - and mm.ver functions do not work as expected. Adjustments were necessary for MMB4W because the MM.Info(FREE SPACE) function does not work. Regards Michael and happy Easter! causality ≠ correlation ≠ coincidence |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3801 |
Regards Michael and happy Easter! I feel they're worth reporting to Peter - he may fix them :) John |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
Hi John, I'm sure he will fix - sooner or later. I feel like I'm the only one using low-level file operations. Best regards Michael causality ≠ correlation ≠ coincidence |
||||
JohnS Guru Joined: 18/11/2011 Location: United KingdomPosts: 3801 |
You might be the only one doing exactly those things - or others may not have noticed the problems... (gulp) John |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
causality ≠ correlation ≠ coincidence |
||||
Mixtel90 Guru Joined: 05/10/2019 Location: United KingdomPosts: 6785 |
Due to firmware updates I rarely keep much on A: anyway. Most stuff is on a couple of SD cards or on the PC. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
matherp Guru Joined: 11/12/2012 Location: United KingdomPosts: 9112 |
CMM2: V5.07.02b1: Minor bug fixes mm.ver == mm.info(version) Edited 2024-04-01 21:39 by matherp |
||||
twofingers Guru Joined: 02/06/2014 Location: GermanyPosts: 1241 |
@Peter: You're right! Fixed 3 years ago. Best regards Michael NSAv101 revised: nsa101.zip Edited 2024-04-03 00:52 by twofingers causality ≠ correlation ≠ coincidence |
||||
Print this page |