summaryrefslogtreecommitdiff
path: root/file_io
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-12 01:32:55 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-02-12 01:32:55 +0000
commit24c81ee6f8ab88b79f8e53dd50706633862e299e (patch)
treebc58e05d41611fd1a31b999eb4b26e77139ee991 /file_io
parent766ae3781f3e5faa2d7bcc7ff1fee95d153ca153 (diff)
downloadlibapr-24c81ee6f8ab88b79f8e53dd50706633862e299e.tar.gz
stdfoo handles are unsupported on WinCE. Submitted by Mladen Turk
<mturk@mappingsoft.com>. I believe the patch for CE is wrong is one respect, IIRC we should fall over from MoveFile to CopyFile if the file device varied. Confirmation? git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62955 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io')
-rw-r--r--file_io/win32/open.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/file_io/win32/open.c b/file_io/win32/open.c
index db89eae89..78f8bd94f 100644
--- a/file_io/win32/open.c
+++ b/file_io/win32/open.c
@@ -59,10 +59,14 @@
#include "apr_strings.h"
#include "apr_portable.h"
#include "apr_thread_mutex.h"
+#if APR_HAVE_ERRNO_H
#include <errno.h>
+#endif
#include <winbase.h>
#include <string.h>
+#if APR_HAVE_SYS_STAT_H
#include <sys/stat.h>
+#endif
#include "misc.h"
#if APR_HAS_UNICODE_FS
@@ -466,8 +470,12 @@ APR_DECLARE(apr_status_t) apr_file_rename(const char *frompath,
/ sizeof(apr_wchar_t), topath)) {
return rv;
}
+#ifndef _WIN32_WCE
if (MoveFileExW(wfrompath, wtopath, MOVEFILE_REPLACE_EXISTING |
MOVEFILE_COPY_ALLOWED))
+#else
+ if (MoveFileW(wfrompath, wtopath))
+#endif
return APR_SUCCESS;
#else
if (MoveFileEx(frompath, topath, MOVEFILE_REPLACE_EXISTING |
@@ -530,6 +538,9 @@ APR_DECLARE(apr_status_t) apr_file_eof(apr_file_t *fptr)
APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t *cont)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
apr_os_file_t file_handle;
file_handle = GetStdHandle(STD_ERROR_HANDLE);
@@ -537,10 +548,14 @@ APR_DECLARE(apr_status_t) apr_file_open_stderr(apr_file_t **thefile, apr_pool_t
return APR_EINVAL;
return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
}
APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t *cont)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
apr_os_file_t file_handle;
file_handle = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -548,10 +563,14 @@ APR_DECLARE(apr_status_t) apr_file_open_stdout(apr_file_t **thefile, apr_pool_t
return APR_EINVAL;
return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
}
APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *cont)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
apr_os_file_t file_handle;
file_handle = GetStdHandle(STD_INPUT_HANDLE);
@@ -559,6 +578,7 @@ APR_DECLARE(apr_status_t) apr_file_open_stdin(apr_file_t **thefile, apr_pool_t *
return APR_EINVAL;
return apr_os_file_put(thefile, &file_handle, 0, cont);
+#endif
}
APR_POOL_IMPLEMENT_ACCESSOR_X(file, cntxt);