}
/* }}} */
-static int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
+TSRM_API int win32_utime(const char *filename, struct utimbuf *buf) /* {{{ */
{
FILETIME mtime, atime;
HANDLE hFile;
#define VCWD_REALPATH(path, real_path) tsrm_realpath(path, real_path TSRMLS_CC)
#if HAVE_UTIME
-#define VCWD_UTIME(path, time) utime(path, time)
+# ifdef TSRM_WIN32
+# define VCWD_UTIME(path, time) win32_utime(path, time)
+# else
+# define VCWD_UTIME(path, time) utime(path, time)
+# endif
#endif
+
#define VCWD_CHMOD(path, mode) chmod(path, mode)
#if !defined(TSRM_WIN32) && !defined(NETWARE)
#define VCWD_CHOWN(path, owner, group) chown(path, owner, group)
fAccess = bucket->is_readable;
goto Finished;
}
- desired_access = FILE_GENERIC_READ;
+ desired_access = FILE_GENERIC_READ|FILE_FLAG_BACKUP_SEMANTICS;
} else { // if(mode <= 6)
if(bucket != NULL && bucket->is_rvalid && bucket->is_wvalid) {
fAccess = bucket->is_readable & bucket->is_writable;
TSRM_API FILE *popen(const char *command, const char *type);
TSRM_API int pclose(FILE *stream);
TSRM_API int tsrm_win32_access(const char *pathname, int mode);
+TSRM_API int win32_utime(const char *filename, struct utimbuf *buf);
TSRM_API int shmget(int key, int size, int flags);
TSRM_API void *shmat(int key, const void *shmaddr, int flags);
--- /dev/null
+--TEST--\r
+Test fopen() function : variation: interesting paths, no use include path\r
+--FILE--\r
+<?php\r
+// fopen with interesting windows paths.\r
+$testdir = __DIR__ . '/bug47177.tmpdir';\r
+mkdir($testdir);\r
+$t = time() - 3600;\r
+touch($testdir, $t);\r
+clearstatcache();\r
+$t2 = filemtime($testdir);\r
+if ($t2 != $t) echo "failed (got $t2, expecting $t)\n";\r
+rmdir($testdir);\r
+echo "Ok.";\r
+?>\r
+--EXPECTF--\r
+Ok.\r