-/* $Id: mfile.c,v 1.57 2004-12-08 12:23:08 adam Exp $
- Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003
- Index Data Aps
+/* $Id: mfile.c,v 1.63 2006-04-05 02:02:36 adam Exp $
+ Copyright (C) 1995-2005
+ Index Data ApS
This file is part of the Zebra server.
#include <fcntl.h>
#ifdef WIN32
#include <io.h>
-#else
+#endif
+#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <direntz.h>
#include <errno.h>
#include <zebra-lock.h>
-#include <zebrautl.h>
+#include <idzebra/util.h>
+#include <yaz/yaz-util.h>
#include "mfile.h"
static int scan_areadef(MFile_area ma, const char *ad, const char *base)
if (!mf->wr && errno == ENOENT && off == 0)
return -2;
yaz_log (YLOG_WARN|YLOG_ERRNO, "Failed to open %s", mf->files[c].path);
- return -1;
+ return -1;
}
}
ps = pos - off;
{
int i;
- yaz_log (YLOG_DEBUG, "mf_close(%s)", mf->name);
+ yaz_log (YLOG_DEBUG, "mf_close(%s) unlink=%d", mf->name, mf->unlink_flag);
assert(mf->open);
for (i = 0; i < mf->no_files; i++)
{
int mf_unlink(MFile mf)
{
if (mf->open)
+ {
mf->unlink_flag = 1;
+ }
else
{
int i;
return 0;
}
-/*
- * Unlink the file by name, rather than MFile-handle. File should be closed.
- */
-int mf_unlink_name(MFile_area ma, const char *name)
-{
- abort();
- return 0;
-}