From d355e8cffa3f46c384ad71bf27920d25c743cda8 Mon Sep 17 00:00:00 2001 From: Marco Castelluccio Date: Wed, 31 Dec 2014 01:24:50 +0100 Subject: [PATCH] Don't create file in RandomAccessStream::open if mode is READ --- midp/fs.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/midp/fs.js b/midp/fs.js index e49f2878..09043cc3 100644 --- a/midp/fs.js +++ b/midp/fs.js @@ -603,6 +603,8 @@ Native.create("com/sun/midp/io/j2me/storage/RandomAccessStream.open.(Ljava/lang/ fs.exists(path, function(exists) { if (exists) { open(); + } else if (mode == 1) { + reject(new JavaException("java/io/IOException", "RandomAccessStream::open(" + path + ") file doesn't exist")); } else { fs.create(path, new Blob(), function(created) { if (created) {