httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@raleigh.ibm.com>
Subject Re: {PATCH} ap_put_statinfo
Date Mon, 08 Nov 1999 12:34:22 GMT

This isn't portable enough, unless we define a stat structure.  I am 99%
sure that Windows doesn't use stat to get file info.  I'll have to take a
look at this code before I can seriously suggest an alternative though.

Ryan

On Tue, 2 Nov 1999, David Reid wrote:

> Whilst looking into the ap_mmap stuff it seemed like a good idea to add the
> following function.  Rather than just committing I'm flagging it here as it
> might not be portable etc etc
> 
> Anyway, I'll commit it later this week unless there's a reason not to.
> 
> For an idea of where this might be useful can I point you at default_handler
> in http_core.c for the mmap sections.
> 
> david
> 
> --- /boot/home/cvs/apache-2.0/src/lib/apr/include/apr_file_io.h Sat Oct 16
> 12:46:13 1999
> +++ include/apr_file_io.h Tue Nov  2 21:27:27 1999
> @@ -58,6 +58,7 @@
> 
>  #include "apr_general.h"
>  #include "apr_errno.h"
> +#include <sys/stat.h>
>  #ifdef HAVE_TIME_H
>  #include <time.h>
>  #endif
> @@ -162,6 +163,8 @@
>  ap_status_t ap_get_fileatime(time_t *, ap_file_t *);
>  ap_status_t ap_get_filectime(time_t *, ap_file_t *);
>  ap_status_t ap_get_filemtime(time_t *, ap_file_t *);
> +
> +ap_status_t ap_put_statinfo(ap_file_t *, struct stat *);
> 
>  #ifdef __cplusplus
>  }
> diff -ru /boot/home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c
> unix/filestat.c
> --- /boot/home/cvs/apache-2.0/src/lib/apr/file_io/unix/filestat.c Tue Oct  5
> 02:15:19 1999
> +++ unix/filestat.c Tue Nov  2 21:27:14 1999
> @@ -84,3 +84,19 @@
>      }
>  }
> 
> +ap_status_t ap_put_statinfo(struct file_t *thefile, struct stat *theinfo)
> +{
> +    if (thefile == NULL)
> +        return APR_EBADF;
> +
> +    thefile->protection = theinfo->st_mode;
> +    thefile->user = theinfo->st_uid;
> +    thefile->group = theinfo->st_gid;
> +    thefile->size = theinfo->st_size;
> +    thefile->atime = theinfo->st_atime;
> +    thefile->mtime = theinfo->st_mtime;
> +    thefile->ctime = theinfo->st_ctime;
> +    thefile->stated = 1;
> +    return APR_SUCCESS;
> +}
> +
> 
> 

_______________________________________________________________________
Ryan Bloom		rbb@raleigh.ibm.com
4205 S Miami Blvd	
RTP, NC 27709		It's a beautiful sight to see good dancers 
			doing simple steps.  It's a painful sight to
			see beginners doing complicated patterns.	


Mime
View raw message