apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: apr/file_io/os2 filestat.c
Date Fri, 31 Aug 2001 17:55:31 GMT
bjh         01/08/31 10:55:31

  Modified:    file_io/os2 filestat.c
  Log:
  OS/2: in apr_stat(), fill in finfo->name if it's asked for.
  
  Revision  Changes    Path
  1.23      +16 -0     apr/file_io/os2/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/os2/filestat.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- filestat.c	2001/08/10 21:04:47	1.22
  +++ filestat.c	2001/08/31 17:55:31	1.23
  @@ -58,6 +58,7 @@
   #include "apr_file_io.h"
   #include "apr_lib.h"
   #include <sys/time.h>
  +#include "apr_strings.h"
   
   
   static void FS3_to_finfo(apr_finfo_t *finfo, FILESTATUS3 *fstatus)
  @@ -159,10 +160,25 @@
       
       finfo->protection = 0;
       finfo->filetype = APR_NOFILE;
  +    finfo->name = NULL;
       rc = DosQueryPathInfo(fname, FIL_STANDARD, &fstatus, sizeof(fstatus));
       
       if (rc == 0) {
           FS3_to_finfo(finfo, &fstatus);
  +
  +        if (wanted & APR_FINFO_NAME) {
  +            ULONG count = 1;
  +            HDIR hDir = HDIR_SYSTEM;
  +            FILEFINDBUF3 ffb;
  +            rc = DosFindFirst(fname, &hDir,
  +                              FILE_DIRECTORY|FILE_HIDDEN|FILE_SYSTEM|FILE_ARCHIVED,
  +                              &ffb, sizeof(ffb), &count, FIL_STANDARD);
  +            if (rc == 0 && count == 1) {
  +                finfo->name = apr_pstrdup(cont, ffb.achName);
  +                finfo->valid |= APR_FINFO_NAME;
  +            }
  +        }
  +
           return APR_SUCCESS;
       } else if (rc == ERROR_INVALID_ACCESS) {
           memset(finfo, 0, sizeof(apr_finfo_t));
  
  
  

Mime
View raw message