[cc65] Request from a user leads to this question

From: Payton Byrd <plbyrd1gmail.com>
Date: 2010-05-06 19:42:01
A user of CBM-Command has requested the ability to see long filenames (those
longer than 16 characters).  Some newer devices will return long filenames,
especially devices using FAT32 storage cards.  How much work would it be,
and is the cc65 community willing to tackle it, to change the cbm_dirent
struct to accommodate long filenames?  I can see a couple of challenges
myself:

1) The current cbm_dirent's name string is a hard coded array.  Making it
bigger would use a lot more RAM in programs already written.
2) Changing the current cbm_dirent's name to a pointer would require
changing any sources using it today to recompile.  Not good.

So, my proposed solution would be to create a new struct, let's say
cbm_longdirent that would be declared as:

struct cbm_longdirent
{
    unsigned char* name;
    unsigned char namelength;
    unsigned int size;
    unsigned char type;
    unsigned char access;
}

Also a new method would be needed for reading the directory:
unsigned char __fastcall__ cbm_readdirlong (unsigned char lfn, struct
cbm_longdirent* l_dirent);

I do think there are some advantages to this approach:

1) The filename being a pointer instead of a hardcoded array could mean
substantial memory savings over large sets of cbm_longdirent structures
compared to using the cbm_dirent structure.

2) It's simply more generalized and to me would be the only method I'd need.
 The old method and struct could be deprecated.

Let me know what you guys think.

-- 
Payton Byrd
<http://www.paytonbyrd.com>
<http://it.toolbox.com/blogs/paytonbyrd>

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu May 6 19:42:30 2010

This archive was generated by hypermail 2.1.8 : 2010-05-06 19:42:33 CEST