Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Martin Gregorie Newsgroups: comp.lang.java.programmer Subject: Re: A "current directory" concept for Java... Date: Fri, 22 Aug 2014 19:26:35 +0000 (UTC) Organization: A noiseless patient Spider Lines: 24 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 22 Aug 2014 19:26:35 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="e5160e2be48f1ea550cf61512446f525"; logging-data="17140"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+UIcc8HZ7j9Cg2LUt4+/DJnxN2ScwKpgg=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:CztJTwCgrMn+Jz/fbenrSMW93DA= Xref: csiph.com comp.lang.java.programmer:29807 On Fri, 22 Aug 2014 16:49:12 +0000, Andreas Leitgeb wrote: > I'm fully aware, that the concept of a mutable "current directory" for > the whole VM does not work at all well with threads, and thus there is > of course no such thing like "System.chDir(...)" in Java. > Unless I missed something, on a Unix/Linux system the Java 'current directory' is the directory in $PWD when the JVM is started and all relative filenames are relative to $PWD. I filename os relative unless it starts with '/'. Isn't it the same on a Windows box except that an absolute name will start with a drive designator? Apart from that, anything else I've needed can be achieved by judicious use of the File class. At least, that's been my experience and I've written command line Java programs that walk directory structures examining the files and directories they find there and applying appropriate actions. -- martin@ | Martin Gregorie gregorie. | Essex, UK org |