SD Card interface: Can I read names of files already on card?
FlyingFishFinger
Posts: 461
That would be nice. I've got a device hooked to a card that generates files with random names (unpredictable, really, unless I exactly synced an RTC with the internal clock of the other device...filenames include a timestamp down to the second). I need to be able to access these files with the propeller, but as far as I can tell, the SD card object requires a known filename to be specified.
Is there a way around this?
Thanks
Rafael
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You've got to play the game.
You can't win.
You can't break even, except on a very cold day.
It doesn't get that cold.
~Laws of Thermodynamics~
Is there a way around this?
Thanks
Rafael
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You've got to play the game.
You can't win.
You can't break even, except on a very cold day.
It doesn't get that cold.
~Laws of Thermodynamics~
Comments
I'm not sure why you would want to name files randomly, unless, of course, you have time stamps recorded inside the files along with whatever data you record. You might what to elaborate more on what you're trying to do both on the data recording end of it and on the data accessing end of it.
Rafael
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
You've got to play the game.
You can't win.
You can't break even, except on a very cold day.
It doesn't get that cold.
~Laws of Thermodynamics~
2) There are PUB routines in the SD card object called "opendir" and "nextfile" used to make directory listings. You could use these to either go through all the root files in directory order looking for one that matches some criteria that you specify, then open the file using its name. You'd have to go through the file list each time unless you want to save the names in an array to speed up the process next time.
re-inventing the wheel.
http://forums.parallax.com/showthread.php?p=719452
OBC
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
New to the Propeller?
Getting started with a Propeller Protoboard?
Check out: Introduction to the Proboard & Propeller Cookbook 1.4
Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
Got an SD card connected? - PropDOS
here's the relevant code from Femto...