Source code: ClassLib/sun13_win32/java/io/Win32FileSystem.java
1 // Win32FileSystem.java, created Fri Jan 11 17:09:56 2002 by joewhaley
2 // Copyright (C) 2001-3 John Whaley <jwhaley@alum.mit.edu>
3 // Licensed under the terms of the GNU LGPL; see COPYING for details.
4 package ClassLib.sun13_win32.java.io;
5
6 import Memory.HeapAddress;
7 import Run_Time.SystemInterface;
8
9 /**
10 * Win32FileSystem
11 *
12 * @author John Whaley <jwhaley@alum.mit.edu>
13 * @version $Id: Win32FileSystem.java,v 1.9 2003/05/12 10:04:55 joewhaley Exp $
14 */
15 public abstract class Win32FileSystem {
16
17 // gets the current directory on the named drive.
18 private static String getDriveDirectory(int i) {
19 byte[] b = new byte[256];
20 int result = SystemInterface.fs_getdcwd(i, b);
21 if (result == 0) throw new InternalError();
22 String res = SystemInterface.fromCString(HeapAddress.addressOf(b));
23 // skip "C:"
24 if (res.charAt(1) == ':') return res.substring(2);
25 else return res;
26 }
27
28 }