Re: {Disarmed} Calling unix functions from Lispworks
I didn't know about HCL:GET-WORKING-DIRECTORY (but now I do, thanks!),
but there's also SYSTEM:CURRENT-DIRECTORY which is exported, but
doesn't seem to be documented (I only just realized that now).
However, it has the useful feature that it takes an optional
relative-directory:
CL-USER 11 > (sys:current-directory)
#P"/Users/tayloj/"
CL-USER 12 > (sys:current-directory #P"subdirectory1/subdirectory2/")
#P"/Users/tayloj/subdirectory1/subdirectory2/"
//JT
On Mon, Aug 11, 2008 at 8:45 AM, Chun Tian (binghe)
<binghe.lisp@gmail.com> wrote:
> HCL:GET-WORKING-DIRECTORY:
> http://www.lispworks.com/documentation/lw51/LWRM/html/lwref-219.htm#pgfId-889197
> There're 3 important packages in LispWorks: HCL (Harlequin-Common-Lisp),
> SYSTEM, and LISPWORKS, if you read LW Reference Manual about functions in
> these packages, you'll find many useful utlilities. But these functions are
> not portable, if you focus in writing portable CL applications, you should
> not use them, try other portable packages.
> --binghe
> 在 2008-8-11,下午8:37, Mauricio Toro 写道:
>
> Hello again,
> I still have one little problem.
> How can I know the current path where I am working on?
> for example "/Users/me/Desktop" and how can I change
> this path.
> The problem arises when I do something like
> (system:call-system-showing-output "ls")
> it always execute the shell command in the root directory ("/") and I do not
> know how to change it.
> Thanks for all,
> Mauricio
> 2008/8/11 Peder O. Klingenberg <pok@netfonds.no>
>>
>> Espen Vestre <ev@netfonds.no> writes:
>>
>> > That will run call-system-showing-output, which may or may not be what
>> > you want (if you want to parse the output of the shell command, you
>> > need to use open-pipe).
>>
>> Not necessarily. You can wrap call-system-showing-output in
>> (with-output-to-string (*standard-output*) ...)
>>
>> --
>> Mvh/Regards
>> Peder O. Klingenberg
>> Netfonds Bank ASA
>
>
>
> --
> Mauricio Toro Bermudez
> Estudiante de Ingeniería de Sistemas
> Pontificia Universidad Javeriana, Colombia
>
> Stagiare à l'Ircam
> 1, place Igor-Stravinsky 75004 Paris,
> France de 2008 à 2009
>
>
--
=====================
Joshua Taylor
tayloj@cs.rpi.edu, jtaylor@alum.rpi.edu
"A lot of good things went down one time,
back in the goodle days."
John Hartford