apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/file_io/win32 dir.c
Date Tue, 23 Jan 2001 17:51:03 GMT
wrowe       01/01/23 09:51:02

  Modified:    file_io/win32 dir.c
  Log:
    Add a healthy bit of extra native info to win32's apr_dir_read()
  
  Revision  Changes    Path
  1.45      +15 -7     apr/file_io/win32/dir.c
  
  Index: dir.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/win32/dir.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- dir.c	2001/01/23 04:10:46	1.44
  +++ dir.c	2001/01/23 17:50:58	1.45
  @@ -200,12 +200,15 @@
           }
           finfo->name = thedir->n.entry->cFileName;
       }
  -
  -    finfo->valid = APR_FINFO_NAME | APR_FINFO_SIZE | APR_FINFO_MTIME;    
  -    finfo->fname = NULL;
  -    finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD) + 
  -                  thedir->n.entry->nFileSizeLow;
  -    FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime);
  +    finfo->cntxt = thedir->cntxt;
  +    finfo->valid = APR_FINFO_NAME | APR_FINFO_TYPE | APR_FINFO_CTIME
  +                 | APR_FINFO_ATIME | APR_FINFO_MTIME | APR_FINFO_SIZE;
  +    /* Do the best job we can determining the file type.
  +     * Win32 only returns device names in a directory in response to a specific
  +     * request (e.g. FindFirstFile("CON"), not to wildcards, so we will ignore
  +     * the BLK, CHR, and other oddballs, since they should -not- occur in this
  +     * context.
  +     */.
       if (thedir->n.entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
           finfo->filetype = APR_DIR;
           finfo->valid |= APR_FINFO_TYPE;
  @@ -215,10 +218,15 @@
           finfo->valid |= APR_FINFO_TYPE | APR_FINFO_LINK;
       }
       else {
  -        /* XXX: Not good logic.  No devices here, but what might we find? */
           finfo->filetype = APR_REG;
           finfo->valid |= APR_FINFO_TYPE;
       }
  +    FileTimeToAprTime(&finfo->ctime, &thedir->n.entry->ftCreationTime);
  +    FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime);
  +    FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime);
  +    finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD)
  +                +  thedir->n.entry->nFileSizeLow;
  +    finfo->fname = NULL;
       return APR_SUCCESS;
   }
   
  
  
  

Mime
View raw message