X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Fdir.c;h=c4201c69271f193968ca5ee2276959c61b36d282;hb=c95a9e501773dedb579f26c59bfd529d0ef9c6ec;hp=cd80bffa05e2892b085f7624cb652d05a1a095c7;hpb=ea01436a957572aaaa878b59469a4cedce7e5e21;p=idzebra-moved-to-github.git diff --git a/index/dir.c b/index/dir.c index cd80bff..c4201c6 100644 --- a/index/dir.c +++ b/index/dir.c @@ -1,10 +1,35 @@ /* - * Copyright (C) 1994-1995, Index Data I/S + * Copyright (C) 1994-1998, Index Data * All rights reserved. * Sebastian Hammer, Adam Dickmeiss * * $Log: dir.c,v $ - * Revision 1.11 1995-11-20 16:59:44 adam + * Revision 1.19 1998-11-03 10:16:11 adam + * Uses stat and not lstat so that file traversal follows symbolic links. + * + * Revision 1.18 1997/09/25 14:55:33 adam + * Windows port uses stat and not lstat. + * + * Revision 1.17 1997/09/09 13:38:06 adam + * Partial port to WIN95/NT. + * + * Revision 1.16 1996/10/29 14:06:45 adam + * Include zebrautl.h instead of alexutil.h. + * + * Revision 1.15 1996/06/04 10:18:58 adam + * Minor changes - removed include of ctype.h. + * + * Revision 1.14 1996/04/09 06:49:18 adam + * Traversal of directories doesn't follow symbolic links. + * + * Revision 1.13 1996/03/21 14:50:08 adam + * File update uses modify-time instead of change-time. + * + * Revision 1.12 1996/02/05 12:29:55 adam + * Logging reduced a bit. + * The remaining running time is estimated during register merge. + * + * Revision 1.11 1995/11/20 16:59:44 adam * New update method: the 'old' keys are saved for each records. * * Revision 1.10 1995/11/20 11:56:22 adam @@ -42,15 +67,15 @@ #include #include #include +#ifndef WINDOWS #include -#include +#endif +#include #include #include #include #include -#include -#include #include "index.h" struct dir_entry *dir_open (const char *rep) @@ -63,7 +88,7 @@ struct dir_entry *dir_open (const char *rep) size_t idx = 0; struct dir_entry *entry; - logf (LOG_LOG, "dir_open %s", rep); + logf (LOG_DEBUG, "dir_open %s", rep); if (!(dir = opendir(rep))) { logf (LOG_WARN|LOG_ERRNO, "opendir %s", rep); @@ -97,14 +122,14 @@ struct dir_entry *dir_open (const char *rep) { case S_IFREG: entry[idx].kind = dirs_file; - entry[idx].ctime = finfo.st_ctime; + entry[idx].mtime = finfo.st_mtime; entry[idx].name = xmalloc (strlen(dent->d_name)+1); strcpy (entry[idx].name, dent->d_name); idx++; break; case S_IFDIR: entry[idx].kind = dirs_dir; - entry[idx].ctime = finfo.st_ctime; + entry[idx].mtime = finfo.st_mtime; entry[idx].name = xmalloc (strlen(dent->d_name)+2); strcpy (entry[idx].name, dent->d_name); strcat (entry[idx].name, "/"); @@ -114,7 +139,7 @@ struct dir_entry *dir_open (const char *rep) } entry[idx].name = NULL; closedir (dir); - logf (LOG_LOG, "dir_close"); + logf (LOG_DEBUG, "dir_close"); return entry; }