-/* $Id: mfile.c,v 1.62 2005-06-14 20:28:53 adam Exp $
+/* $Id: mfile.c,v 1.65 2006-05-10 08:13:17 adam Exp $
Copyright (C) 1995-2005
Index Data ApS
{
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)
+int mf_area_directory_stat(MFile_area ma, int no, const char **directory,
+ double *used_bytes, double *max_bytes)
{
- abort();
- return 0;
+ int i;
+ mf_dir *d = ma->dirs;
+ for (i = 0; d && i<no; i++, d = d->next)
+ ;
+ if (!d)
+ return 0;
+ if (directory)
+ *directory = d->name;
+ if (max_bytes)
+ *max_bytes = d->max_bytes;
+ if (used_bytes)
+ *used_bytes = d->max_bytes - d->avail_bytes;
+ return 1;
}
+/*
+ * Local variables:
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ * vim: shiftwidth=4 tabstop=8 expandtab
+ */
+