Post Reply 
50G: SD card commands
05-08-2015, 02:00 PM
Post: #3
RE: 50G: SD card commands
(05-08-2015 01:47 PM)Joe Horn Wrote:  
(05-08-2015 12:44 PM)Dave Britten Wrote:  Does the 50G have commands for working with files on the SD card? I mainly need to be able to check if a file exists, and also copy and/or rename a file without copying the entire file contents to main memory (which might not have enough space free to hold the entire file). This is mostly for manipulating backup files.

Use VTYPE to test if a file exists in the SD card. Example:
':3:FOO' VTYPE
returns the file type if it exists, or -1 if it does not exist.

The RENAME function does not work on SD card files. However, there are libraries that include rename functions for SD card files. One such library is SDFiler by Tim Wessman and Claudio Daniel Lapilli.

Yeah, I was using VTYPE in my script (:3:BACKUP.50G IF DUP VTYPE 17. == ...), then I started getting an insufficient memory error. As far as I can tell, it's recalling the object to main memory to evaluate the type, so if your backup is larger than the amount of free memory, you're out of luck.

This also presents a problem for copying the backup to a different file by recalling it to the stack. I may have to try an entirely different approach if I want rotating backups.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
50G: SD card commands - Dave Britten - 05-08-2015, 12:44 PM
RE: 50G: SD card commands - Joe Horn - 05-08-2015, 01:47 PM
RE: 50G: SD card commands - Dave Britten - 05-08-2015 02:00 PM
RE: 50G: SD card commands - Joe Horn - 05-08-2015, 04:03 PM
RE: 50G: SD card commands - Dave Britten - 05-08-2015, 05:35 PM



User(s) browsing this thread: 1 Guest(s)