You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bj...@apache.org on 2001/08/31 19:55:31 UTC

cvs commit: apr/file_io/os2 filestat.c

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));