This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FAT FS questions


Andrew Lunn <andrew@lunn.ch> writes:

> On Mon, Oct 04, 2004 at 07:14:40PM -0700, David Brennan wrote:
> > Ok, so my plan was to add a chmod function. However, after looking at 
> > the was the file system functions are structured, this may not be the 
> > simplest solution. Actually it should be pretty easy to add a new 
> > function to the fstab_entry list and then to each of the 4 supported 
> > file systems. Make the functions just return EINVAL for the file systems 
> > which do not support chmod.
> 
> This is the correct solution for me, but Nick is the filesystem
> architect so really his comment would be useful.

The getinfo() and setinfo() functions are explicitly intended to
support these odd little filesystem functions without endlessly
extending the function tables and having to change all filesystems
each time a new one is added.

Just add a new key and a data structure for the arguments to
fileio.h. Then add a chmod() function to file.cxx -- just copy and
edit pathconf() (but call setinfo() instead of getinfo() obviously).

The hardest part is getting the mapping from the POSIX style access
mode to the FAT modes. Best to find out how Linux does it and do the
same.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]