FTP file system and cp shell command

Joel Sherrill joel.sherrill at OARcorp.com
Thu Mar 26 11:13:03 UTC 2009


Sebastian Huber wrote:
> Hi,
>
> I started to rewrite the FTP file system (FTP client).  One goal is to support
> the standard cp shell command.  So I have to provide some sort of information
> for stat().  My current approach looks like:
>
> static int rtems_ftpfs_fstat(
>   rtems_filesystem_location_info_t *loc,
>   struct stat *st
> )
> {
>   memset( st, 0, sizeof( *st));
>
>   st->st_mode = S_IFREG | S_IRWXU | S_IRWXG | S_IRWXO;
>
>   return 0;
> }
>
> This works fine for "cp local remote" and "cp remote local" variants.  The case
> "cp remote remote" fails because the node index (st->ino) and device (st->dev)
> is equal to zero for both remote files.  So cp assumes that the files are
> identical and there is nothing to copy.  Does anyone know a good way to provide
> a fake node index?
>
>   
Have a global/static "node counter" and increment it on
every open?
> Have a nice day!
>
>   
--joel




More information about the users mailing list