/* This file is part of Lcrzo.
*/

int lcrzo_priv_filename_stat_get(const char *filename, 
			     struct stat *pst)
{ int ret;

  if (filename==NULL) return(LCRZO_ERR_PANULLPTR);
  if (pst==NULL) return(LCRZO_ERR_PANULLPTR);
#if defined LCRZODEF_SYSTEM_Unix
  ret=lstat(filename, pst);
#elif defined LCRZODEF_SYSTEM_Windows
  ret=_stat(filename, (struct _stat*)pst);
#else
 #error "Unknown value for LCRZODEF_SYSTEM"
#endif
  if (ret==-1)
  { if (errno==ENOENT) 
    { lcrzo_priv_global_set_errmsglcrzo(filename);
      return(LCRZO_ERR_OKFILENOTFOUND);
    }
    return(LCRZO_ERR_FULSTAT);
  }
  return(LCRZO_ERR_OK);
}

