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 2005/07/16 10:10:50 UTC
svn commit: r219296 - in /apr/apr/branches/1.1.x: file_io/os2/filestat.c
include/arch/os2/apr_arch_file_io.h time/unix/time.c
Author: bjh
Date: Sat Jul 16 01:10:49 2005
New Revision: 219296
URL: http://svn.apache.org/viewcvs?rev=219296&view=rev
Log:
OS/2: Implement apr_file_mtime_set().
Backport from trunk of r219295.
Modified:
apr/apr/branches/1.1.x/file_io/os2/filestat.c
apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h
apr/apr/branches/1.1.x/time/unix/time.c
Modified: apr/apr/branches/1.1.x/file_io/os2/filestat.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/file_io/os2/filestat.c?rev=219296&r1=219295&r2=219296&view=diff
==============================================================================
--- apr/apr/branches/1.1.x/file_io/os2/filestat.c (original)
+++ apr/apr/branches/1.1.x/file_io/os2/filestat.c Sat Jul 16 01:10:49 2005
@@ -225,5 +225,16 @@
apr_time_t mtime,
apr_pool_t *pool)
{
- return APR_ENOTIMPL;
+ FILESTATUS3 fs3;
+ ULONG rc;
+ rc = DosQueryPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3));
+
+ if (rc) {
+ return APR_FROM_OS_ERROR(rc);
+ }
+
+ apr_apr_time_to_os2_time(&fs3.fdateLastWrite, &fs3.ftimeLastWrite, mtime);
+
+ rc = DosSetPathInfo(fname, FIL_STANDARD, &fs3, sizeof(fs3), 0);
+ return APR_FROM_OS_ERROR(rc);
}
Modified: apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h?rev=219296&r1=219295&r2=219296&view=diff
==============================================================================
--- apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h (original)
+++ apr/apr/branches/1.1.x/include/arch/os2/apr_arch_file_io.h Sat Jul 16 01:10:49 2005
@@ -66,6 +66,8 @@
apr_status_t apr_file_cleanup(void *);
apr_status_t apr_os2_time_to_apr_time(apr_time_t *result, FDATE os2date,
FTIME os2time);
+apr_status_t apr_apr_time_to_os2_time(FDATE *os2date, FTIME *os2time,
+ apr_time_t aprtime);
/* see win32/fileio.h for description of these */
extern const char c_is_fnchar[256];
Modified: apr/apr/branches/1.1.x/time/unix/time.c
URL: http://svn.apache.org/viewcvs/apr/apr/branches/1.1.x/time/unix/time.c?rev=219296&r1=219295&r2=219296&view=diff
==============================================================================
--- apr/apr/branches/1.1.x/time/unix/time.c (original)
+++ apr/apr/branches/1.1.x/time/unix/time.c Sat Jul 16 01:10:49 2005
@@ -266,6 +266,23 @@
*result = mktime(&tmpdate) * APR_USEC_PER_SEC;
return APR_SUCCESS;
}
+
+APR_DECLARE(apr_status_t) apr_apr_time_to_os2_time(FDATE *os2date,
+ FTIME *os2time,
+ apr_time_t aprtime)
+{
+ time_t ansitime = aprtime / APR_USEC_PER_SEC;
+ struct tm *lt;
+ lt = localtime(&ansitime);
+ os2time->hours = lt->tm_hour;
+ os2time->minutes = lt->tm_min;
+ os2time->twosecs = lt->tm_sec / 2;
+
+ os2date->day = lt->tm_mday;
+ os2date->month = lt->tm_mon + 1;
+ os2date->year = lt->tm_year - 80;
+ return APR_SUCCESS;
+}
#endif
#ifdef NETWARE