1
2
3
4 package joeq.ClassLib.sun14_win32.java.io;
5
6 import joeq.Runtime.SystemInterface;
7
8 /***
9 * RandomAccessFile
10 *
11 * @author John Whaley <jwhaley@alum.mit.edu>
12 * @version $Id: RandomAccessFile.java 1456 2004-03-09 22:01:46Z jwhaley $
13 */
14 public class RandomAccessFile {
15
16 private FileDescriptor fd;
17
18 private static final int O_RDONLY = 1;
19 private static final int O_RDWR = 2;
20 private static final int O_SYNC = 4;
21 private static final int O_DSYNC = 8;
22
23 public void open(java.lang.String name, int mode)
24 throws java.io.FileNotFoundException {
25 int flags = SystemInterface._O_BINARY;
26 if ((mode & O_RDONLY) != 0) flags |= SystemInterface._O_RDONLY;
27 if ((mode & O_RDWR) != 0) flags |= SystemInterface._O_RDWR | SystemInterface._O_CREAT;
28 if ((mode & O_SYNC) != 0) {
29
30
31 }
32 if ((mode & O_DSYNC) != 0) {
33
34
35 }
36 int fdnum = SystemInterface.file_open(name, flags, 0);
37 if (fdnum == -1) throw new java.io.FileNotFoundException(name);
38 this.fd.fd = fdnum;
39 }
40
41 }