The Java Developers Almanac 1.4


Order this book from Amazon.

   
Home > List of Packages > java.io  [35 examples] > Directories  [6 examples]

e28. Getting the Current Working Directory

The working directory is the location in the file system from where the java command was invoked.
    String curDir = System.getProperty("user.dir");

 Related Examples
e29. Creating a Directory
e30. Deleting a Directory
e31. Listing the Files or Subdirectories in a Directory
e32. Listing the File System Roots
e33. Traversing the Files and Directories Under a Directory

See also: Encodings    Filenames and Pathnames    Files    Parsing    Reading and Writing    Serialization   


© 2002 Addison-Wesley.