[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FTP file system and cp shell command



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 nice day!

-- 
Sebastian Huber, Embedded Brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request

Diese Nachricht ist keine gesch?ftliche Mitteilung im Sinne des EHUG.