/* By Theo Markettos (theo@markettos.org.uk), written for sshproxy.  This
 * file is public domain
 */

#include <stdio.h>
#include <string.h>
#include "oslib/osfile.h"
#include "oslib/fileswitch.h"

#define cdir(dir) xosfile_create_dir(dir,0);

#define fmove(from,to) xosfscontrol_copy(from,to,osfscontrol_COPY_DELETE,NULL,NULL,NULL,NULL,NULL)

int fexist(char *name)
{
  os_error *result;
  int junk=0;
  fileswitch_object_type type=fileswitch_NOT_FOUND;

  result=xosfile_read_path(name,"",&type,
                           (bits *) &junk,
                           (bits *) &junk,
                           (int *)  &junk,
                           (fileswitch_attr *) &junk);
  if ((result) || (type==fileswitch_NOT_FOUND))
    return FALSE;
  else
    return TRUE;
}
