Re: Directory handling
Mark Evenson <[email protected]> Tue, 11 Jun 2019 11:33:51 +0200
| Newsgroups | gmane.editors.j.devel |
|---|---|
| Message-ID | <C17680E1-2004-4343-96F8-7B1447937557__14714.002148115$1560245663$gmane$org@panix.com> |
> On Jun 5, 2019, at 17:53, Marco Antoniotti <[email protected]> wrote: > > Dear all, > > I have been looking at the ABCL manual and packages and I was not able (my fault!) to find functions like CURRENT-DIRECTORY and/or CHANGE-DIRECTORY (or CHDIR). > > Could you tell me how to get to this functionality? Unfortunately, the JVM doesn’t have a [standard interface to change the working directory][1] there is no direct method to setting the current working directory. The JVM gets a copy of the system environment variables including the current working directory [1]: https://stackoverflow.com/questions/840190/changing-the-current-working-directory-in-java It would help to know more specifically what you wish to do after changing the directory, but here’s a guess at what you may wish to do: If you wish invoke purely Lisp-side functionality, then use the value of CL:*DEFAULT-PATHNAMES-DEFAULTS*, which is what UIOP/OS:GETCWD returns. If you wish to fork processes in another directory then the specify the relavant argument to UIOP/RUN-PROGRAM:RUN-PROGRAM. In very pathlogical cases you may have to write a script that ensures the JVM hosting ABCL is started in the directory you wish to have as the current directory. I had to do this in order to get a Minecraft server to run under ABCL. > Also, what is the set of features that ABCL uses to identify the platform? On a Mac OSX I see (at a minimum): > > :SWANK > :X86-64 > :UNIX > :DARWIN > :ARMEDBEAR > :ABCL > :COMMON-LISP > :ANSI-CL > :CDR6 > :MOP > :PACKAGE-LOCAL-NICKNAMES > NIL > The code which sets platform features is the [best source of what keywords identify which plaform features][2]. Additionaly, there is (incomplete) support for identifying the JVM version by the use of the :java-1.6, :java-1.7, and :java—1.8 keywords. Again, it would be helpful to know what sort of platform features you wish to detect. [2]: https://abcl.org/trac/browser/trunk/abcl/src/org/armedbear/lisp/Lisp.java#L2362 -- "A screaming comes across the sky. It has happened before but there is nothing to compare to it now."