Ticket #12327

Get the current directory - Doesn't Work
Eröffnet am: 2008-04-10 11:47 Letztes Update: 2008-04-17 08:08

Auswertung:
(Anonym)
Verantwortlicher:
Typ:
Status:
Geschlossen
Komponente:
Meilenstein:
(Keine)
Priorität:
5 - Mittel
Schweregrad:
5 - Mittel
Lösung:
Won't Fix
Datei:
Keine

Details

The following code sample should return the current
directory of the running JAR file, however, mysaifu
always returns the root directory "\."

http://www.rgagnon.com/javadetails/java-0076.html

import java.io.File;
public class CurrentDir {
public static void main (String args[]) {
File dir1 = new File (".");
File dir2 = new File ("..");
try {
System.out.println ("Current dir : " +
dir1.getCanonicalPath());
System.out.println ("Parent dir : " +
dir2.getCanonicalPath());
}
catch(Exception e) {
e.printStackTrace();
}
}
}

Ticket-Verlauf (1/1 Historien)

2008-04-17 08:08 Aktualisiert von: freebeans
  • Ticket Close date is changed to 2008-04-17 08:08
  • Verantwortlicher Update from (Keine) to freebeans
  • Lösung Update from Keine to Won't Fix
  • Status Update from Offen to Geschlossen
Kommentar
Logged In: YES
user_id=14530

Windows Mobile does not support "current directory".
If you want to set the current directory, please set
Options/General tab or -setcwd command line option.
http://www2s.biglobe.ne.jp/~dat/java/project/jvm/usage_en.ht
ml

Dateianhangliste

Keine Anhänge

Bearbeiten

Please login to add comment to this ticket » Anmelden