mirror of
https://github.com/corda/corda.git
synced 2025-01-03 19:54:13 +00:00
use _waccess on windows to implement File.can{Read|Write}
This commit is contained in:
parent
d5b35bea6e
commit
74a87a7f4f
@ -25,6 +25,7 @@
|
||||
# include <direct.h>
|
||||
# include <share.h>
|
||||
|
||||
# define ACCESS _waccess
|
||||
# define CLOSE _close
|
||||
# define READ _read
|
||||
# define WRITE _write
|
||||
@ -56,6 +57,7 @@ typedef wchar_t char_t;
|
||||
# include <unistd.h>
|
||||
# include "sys/mman.h"
|
||||
|
||||
# define ACCESS access
|
||||
# define OPEN open
|
||||
# define CLOSE close
|
||||
# define READ read
|
||||
@ -382,7 +384,7 @@ Java_java_io_File_canRead(JNIEnv* e, jclass, jstring path)
|
||||
{
|
||||
string_t chars = getChars(e, path);
|
||||
if (chars) {
|
||||
int r = access(chars, R_OK);
|
||||
int r = ACCESS(chars, R_OK);
|
||||
releaseChars(e, path, chars);
|
||||
return (r == 0);
|
||||
}
|
||||
@ -394,7 +396,7 @@ Java_java_io_File_canWrite(JNIEnv* e, jclass, jstring path)
|
||||
{
|
||||
string_t chars = getChars(e, path);
|
||||
if (chars) {
|
||||
int r = access(chars, W_OK);
|
||||
int r = ACCESS(chars, W_OK);
|
||||
releaseChars(e, path, chars);
|
||||
return (r == 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user