Allow file creation
authorstefan <none@none>
Tue, 11 Mar 2003 09:06:14 +0000 (09:06 +0000)
committerstefan <none@none>
Tue, 11 Mar 2003 09:06:14 +0000 (09:06 +0000)
nat/RandomAccessFile.c

index 1597a55e5e615f05d52d0d18760f00504a970caf..603b4649e716a646a820e3addc6e481a557c73e4 100644 (file)
@@ -62,7 +62,7 @@ JNIEXPORT void JNICALL Java_java_io_RandomAccessFile_open ( JNIEnv *env ,  struc
        s4 fd;
        char *fname = javastring_tochar ((java_objectheader*)name);
        
-       if (writeable) fd = open (fname, O_RDWR, 0);
+       if (writeable) fd = open (fname, O_RDWR|O_CREAT|O_TRUNC, 0666);
        else           fd = open (fname, O_RDONLY, 0);
        if (fd==-1) goto fail;