Open two SD files at the same time?
Rayman
Posts: 14,801
I was just looking into opening two SD card files at the same time using Rockiki's SD object (or maybe·Mike Green's FemtoBasic version)...· I'd like to have one file open·for input·and another file for output...· (I just read a thread concerning this from several months ago)
I'm wondering if I can just store two copies of·the entire VAR section, one for each file and swap them in and out...· It appears to me (although I might be mistaken) that all the file info is stored there...
Anybody think this won't work?· Or, have a better idea?
I'm wondering if I can just store two copies of·the entire VAR section, one for each file and swap them in and out...· It appears to me (although I might be mistaken) that all the file info is stored there...
Anybody think this won't work?· Or, have a better idea?
Comments
If· you can wait a week or two, I'm working on a version of Rokicki's FAT file system driver that supports multiple files (one per instance of the object) and works by sharing the directory / FAT information which is kept in a DAT section.· You'll be able to have several files open for reading or writing, just limited by space (about 600 bytes per file).· I'm trying to add a seek function as well so you can do random access for reading and for updating in place.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I'll save that for the next iteration. I need the multiple open file capability for a project I'm working on, but I don't need the subdirectories for that. I'll keep it in mind though.
Mike
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with the Protoboard? - Propeller Cookbook
Got an SD card? - PropDOS
A Living Propeller FAQ - The Propeller Wiki
(Got the Knowledge? Got a Moment? Add something today!)
Wouldn't FAT data only get stored back for a write operation? I need one file for read and one for write, so I wouldn't think there'd be a conflict...
I was trying to be cautious. Yes, you should be ok with one write operation and any number of reads.
Would be useful!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Share the knowledge: propeller.wikispaces.com
Lets make some music: www.andrewarsenault.com/hss