Ethereal-dev: [Ethereal-dev] file_exists() returning the oposite?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Wed, 8 Feb 2006 00:31:52 +0100
Hi,
I realy do not know if file_exists() from epan/filesystem.c works on
windows but I've seen it does not on my mac and AFAIK it should not
work on *NIX in general.


this is the code:

gboolean
file_exists(const char *fname)
{
  struct stat   file_stat;


  /*
   * This is a bit tricky on win32. The st_ino field is documented as:
   * "The inode, and therefore st_ino, has no meaning in the FAT, ..."
   * but it *is* set to zero if stat() returns without an error,
   * so this is working, but maybe not quite the way expected. ULFL
   */
   file_stat.st_ino = 1;   /* this will make things work if an error occured */
   eth_stat(fname, &file_stat);
   if (file_stat.st_ino == 0) {
       return TRUE;
   } else {
       return FALSE;
   }

}


--
This information is top security. When you have read it, destroy yourself.
-- Marshall McLuhan