Filesystem operations with RTEMS
chrisj at rtems.org
Tue Jul 9 03:01:05 UTC 2013
Mohammed Khoory wrote:
> I have set up a RAMDisk on RTEMS 4.10.2 and formatted it with dosfs, then
> mounted it in a specific address. I'm now trying to do two operations on
> this active filesystem:
> 1. I have an open file in this filesystem, represented in C code as a file
> descriptor int, and I'm trying to get the pathname of this file descriptor.
You would need an RTEMS specific method to be able to do this and I do
not think one exists and I am not sure if it is possible. In POSIX an fd
typically maps to an inode (see the stat st_ino field) and there could
be more than one hard linked file name to that inode. This means an fd
for a file could be referenced by more than one file name.
> 2. I would like to get the amount of free space on this filesystem.
I know 4.11 has support for statvf but I am not sure if this has the
file system space available. It has been a while since I looked at this
and I cannot remember if there is a standard method of obtaining this.
Maybe the BSD 'df' source may provide some pointers.
More information about the users