mirror of
https://github.com/corda/corda.git
synced 2025-01-21 03:55:00 +00:00
The unlink/_wunlink call will not delete directories, use remove/_wremove instead
This commit is contained in:
parent
c06dd28ea0
commit
0db1a2c414
@ -35,7 +35,7 @@
|
|||||||
# define STRUCT_STAT struct _stat
|
# define STRUCT_STAT struct _stat
|
||||||
# define MKDIR(path, mode) _wmkdir(path)
|
# define MKDIR(path, mode) _wmkdir(path)
|
||||||
# define CHMOD(path, mode) _wchmod(path, mode)
|
# define CHMOD(path, mode) _wchmod(path, mode)
|
||||||
# define UNLINK _wunlink
|
# define REMOVE _wremove
|
||||||
# define RENAME _wrename
|
# define RENAME _wrename
|
||||||
# define OPEN_MASK O_BINARY
|
# define OPEN_MASK O_BINARY
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ typedef wchar_t char_t;
|
|||||||
# define STRUCT_STAT struct stat
|
# define STRUCT_STAT struct stat
|
||||||
# define MKDIR mkdir
|
# define MKDIR mkdir
|
||||||
# define CHMOD chmod
|
# define CHMOD chmod
|
||||||
# define UNLINK unlink
|
# define REMOVE remove
|
||||||
# define RENAME rename
|
# define RENAME rename
|
||||||
# define OPEN_MASK 0
|
# define OPEN_MASK 0
|
||||||
|
|
||||||
@ -386,7 +386,7 @@ Java_java_io_File_delete(JNIEnv* e, jclass, jstring path)
|
|||||||
{
|
{
|
||||||
string_t chars = getChars(e, path);
|
string_t chars = getChars(e, path);
|
||||||
if (chars) {
|
if (chars) {
|
||||||
int r = UNLINK(chars);
|
int r = REMOVE(chars);
|
||||||
if (r != 0) {
|
if (r != 0) {
|
||||||
throwNewErrno(e, "java/io/IOException");
|
throwNewErrno(e, "java/io/IOException");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user