1
2
3
4 package joeq.ClassLib.sun14_win32.java.io;
5
6 import joeq.Memory.HeapAddress;
7 import joeq.Runtime.SystemInterface;
8
9
10
11
12
13 public abstract class Win32FileSystem {
14
15 public native java.lang.String canonicalize(java.lang.String s) throws java.io.IOException;
16 public native int getBooleanAttributes(java.io.File f);
17 public native boolean checkAccess(java.io.File f, boolean b);
18 public native long getLastModifiedTime(java.io.File f);
19 public native long getLength(java.io.File f);
20 public native boolean createFileExclusively(java.lang.String s) throws java.io.IOException;
21 public native boolean delete(java.io.File f);
22 public synchronized native boolean deleteOnExit(java.io.File f);
23 public native java.lang.String[] list(java.io.File f);
24 public native boolean createDirectory(java.io.File f);
25 public native boolean rename(java.io.File f1, java.io.File f2);
26 public native boolean setLastModifiedTime(java.io.File f, long t);
27 public native boolean setReadOnly(java.io.File f);
28
29
30 String getDriveDirectory(int i) {
31 byte[] b = new byte[256];
32 int result = SystemInterface.fs_getdcwd(i, b);
33 if (result == 0) throw new InternalError();
34 String res = SystemInterface.fromCString(HeapAddress.addressOf(b));
35
36 if (res.charAt(1) == ':') return res.substring(2);
37 else return res;
38 }
39
40
41 }