Papaof2, there are 8 characters in the filename, 3 for the extension and one for the . so MYFILE04.TXT is allowed but MYFILE103 is one character too long. That could work well though, eg if you had 5 of the 8 characters in the name for the name and then 0 to 999 for the number.
It is great brainstorming this. Say you have a large text file, a Help file for instance, and you write it in notepad and save it and then you want it to print out on an LCD when the user hits a certain key. Well, just read the file size and then run a counter till it gets to the end. So I think Read is pretty straightforward.
Write is the more complex one. I have found when working with picaxes and other small microcontrollers, a mindset develops where you are always trying to save bytes, to save space. With an sd card, there is an abundance of space. How about you make all text files 16k long, and you set up a counter when you open the file, write n bytes, and then when you close it, send padding bytes (? a space character) to fill up the rest of the space.
I wonder if the uDrive might allow string manipulation on a picaxe. Define two strings s1 and s2.
Store those on a uDrive as s1.txt and s2.txt as that might make debugging easier.
Some subroutines:
dim s1 as string [in vb.net notation]
becomes in picaxe basic
b0=s
b1=1
gosub definestring
and definestring opens a udrive text file and prints 32 null (zero) characters using the name s1 and adding .txt to the name.
I'm not sure the most efficient way to put text in a string, maybe with a data statement or maybe even on a PC and create the string files before running the program, but a string text file is always 32 bytes and it ends in a null. So
s1="Hello"
is
72 101 108 108 111 0 0 0 0 0 etc
Now write some functions
len(s1) returns the length in b0
and opens the file s1.txt, reads in 32 bytes and stops a counter when the byte read is equal to 0. It will return 5 for the string above.
Left(s1,3) puts the new string back in s1.txt
It opens the file s1.txt for read, reads in 32 bytes, stores them somewhere (mabye with some pokes) up until 3, puts a null (zero) at position 4, keeps reading till it gets to 32, closes the file, reopens it for write, and writes out the 32 bytes (either 0 after the first null if you want to be neat, or just leave the bytes as they were as everything after a null is ignored anyway)
You can add other string functions eg Mid(), Right(), Asc(), Chr(), Hex() etc.