Re: Directory handling
Marco Antoniotti <[email protected]> Wed, 12 Jun 2019 08:28:01 +0200
| Newsgroups | gmane.editors.j.devel |
|---|---|
| Message-ID | <B44E8905-1D73-4262-A204-4FDF331DFCD0__17833.911317733$1560326590$gmane$org@unimib.it> |
Hi > On Jun 11, 2019, at 11:33 , Mark Evenson <[email protected]> wrote: > > > >> 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 Ok. Thanks. Understood. So this is a Java “feature”. > 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. That is what I fall back to. I was just wondering if there was a “to-the-file-system” primitive. *D-P-D* munging will do. > 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. Ok. Nothing of the kind is really needed. > >> 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 Thanks. I just wanted to know what set of features I can use to know that I am running on a Mac OS X or, say, a Windows 10. It looks like that (and :UNIX :DARWIN) is what I need for Mac OS X and WINDOWS for all Windows. Thanks Marco -- Marco Antoniotti, Associate Professor tel. +39 - 02 64 48 79 01 DISCo, Università Milano Bicocca U14 2043 http://bimib.disco.unimib.it Viale Sarca 336 I-20126 Milan (MI) ITALY Please check: http://cdac2019.lakecomoschool.org Please check: http://troncopackage.org Please check: https://www.frontiersin.org/research-topics/7394/network-bioscience Please note that I am not checking my Spam-box anymore. Please do not forward this email without asking me first (cum grano salis).