This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

RandomAccessFile always creates file with public authority Read on AS400  RSS feed

 
Mark Wheadon
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

You can probably only help if you know IBM AS/400 (iSeries, System i), but I'm stuck on this one so...

Here is my simple code:


This creates two files in my home folder on the AS/400, fos.txt and rafrw.txt, both 0 bytes long, using command:

JAVA CLASS(test.CreateFile4) CLASSPATH('/home/wheadom') PROP((java.version 1.5))

The problem for me is that fos.txt is created with public authority of RW, but rafrw.txt with public authority of Read.

If I start the JVM with the special property os400.file.create.auth RWX:

JAVA CLASS(test.CreateFile4) CLASSPATH('/home/wheadom') PROP((java.version 1.5) (os400.file.create.auth RWX))

then fos.txt is created with public authority RWX (as I would expect), but rafrw.txt is still created with public authority of Read. I delete both files between each test.

There appears to be a difference in the way RandomAccessFile and FileOutputStream operate on the AS/400. This happens on our AS/400 and a customers machine, both running at V540.

Does anyone know why RandomAccessFile always seems to create files with public authority Read and appears to ignore os400.file.create.auth? Am I missing something obvious?

Thanks very much,

Mark W.
 
Rob Spoor
Sheriff
Posts: 21044
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch!

I'll move this to our I/O forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!