TFTP driver changes

Eric Norum eric.norum at
Tue Sep 25 14:23:47 UTC 2001

Till Straumann wrote:
> Here's an idea how (very rudimentary) relative path support could be added
> to TFTPfs:
> - TFTPfs'  rtems_filesystem_node_type() returns 'RTEMS_FILESYSTEM_DIRECTORY'
>    to any call with a pathname argument ending with a slash ('/').  It also stores (a
>    copy of) the pathname in the node_access field. (hence the freenode method
>    would have to be implemented also).
> - TFTPfs' rtems_filesystem_evaluate_path() assembles the absolute path
>    from the prefix (stored in cwd's node_access) and the relative path argument.
>    It then eliminates all occurrences of '.' and '..' before proceeding.
>    Note: this works only as long as no mount points or links are crossed (which
>    are not implemented by TFTPfs anyway).
> The iocsh should then do a eg. chdir("/TFTP/BOOTP_HOST/epics/norumx3/blah/blah/")
> when initializing. This will record "/BOOTP_HOST/epics/norumx3/blah/blah"
> in the cwd structure.

This looks like an excellent idea.  I'll see if I can find some time
today to try it out.
I've got some of questions since this is the first time I've really
played with the RTEMS filesystem stuff.

1) Does RTEMS have an concept of a `current working directory'?  If so,
is it a system-wide or per-task value?  Also, if so, where is the
information held?  How could the drive access this information?

2) How can TFTPfs' rtems_filesystem_evaluate_path() tell whether the
path it's been handed is relative or absolute?  At the moment the
assumption is that the path is always absolute with the host-name as the
component right after the /TFTP/.   Should the driver continue to make
this assumption until it sees a chdir with a trailing (and perhaps
leading) / character and then assume relative paths after that time?

3) Does TFTPfs'  rtems_filesystem_node_type() have to store the copy of
the absolute path in the node_access field (with all the freenode
complications thus implied) or could it just store a copy using a
file-static char * variable?   This relates to question (1).  If the
current directory is a per-task value, I can't see how the system
described by Till will work (since different EPICS tasks want to read
different files).

Eric Norum                                 eric.norum at
Department of Electrical Engineering       Phone: (306) 966-5394
University of Saskatchewan                 FAX:   (306) 966-5407
Saskatoon, Canada.

More information about the users mailing list