helpGNU Common Lisp - Support: sr #109250, How to change the current directory


sr #109250: How to change the current directory

Submitted by:  Gunter Königsmann <peterpall>
Submitted on:  Tue 07 Feb 2017 08:13:56 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  4 - Important Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 05 Sep 2017 05:21:48 AM UTC, comment #3: 

Cool if it is actually ''si::chdir'' that makes it simpler; having no Debian-testing version around, thus I was just guessing from the patches.

Martin Saturka <kvutza>
Tue 05 Sep 2017 05:09:07 AM UTC, comment #2: 

Thanks a lot! About this function I didn't know.

In the meantime I have also found out that si::chdir solves the problem, currently => currently I can provide a wxMaxima that works with gcl. Feel free to close this support request as I don't see an obvious way to close it myself.

Thanks again,


Gunter Königsmann <peterpall>
Mon 04 Sep 2017 11:28:39 PM UTC, comment #1: 

Hi Gunter, Debian/Ubuntu systems use amounts of patches to GCL (and I am not able to reasonably compile GCL without them); let us be grateful to the maintainers for that.
Looking at those patches ("patches" subdirectory of the respective Debian-related tar), it seems that the "pathnames1.2" patch puts "chdir" out of "si" package (the removed ''-  make_si_function("CHDIR", siLchdir);'' line and related stuff) into a top-level function (the added ''+(defun chdir (s)'' line and related stuff).

AFAIK one way of finding whether a function symbol is defined is to use the "fboundp" function, like:
(fboundp 'si:chdir)
(fboundp 'chdir)

Martin Saturka <kvutza>
Tue 07 Feb 2017 08:13:56 PM UTC, original submission:  

In order to make maxima do its file I/O relative to the directory the currently opened worksheet is in wxMaxima uses the following function to change maxima's current directory:

(defun wx-cd (dir)
  (when $wxchangedir
    (let ((dir (cond ((pathnamep dir) dir)
                     ((stringp dir)
                      (make-pathname :directory (pathname-directory dir)
                                     :host (pathname-host dir)
                                     :device (pathname-device dir)))
                     (t (error "cd(dir): dir must be a string or pathname.")))))
       #+allegro (excl:chdir dir)
       #+clisp (ext:cd dir)
       #+cmu (setf (ext:default-directory) dir)
       #+cormanlisp (ccl:set-current-directory dir)
       #+gcl (si:chdir dir)
       #+lispworks (hcl:change-directory dir)
       #+lucid (lcl:working-directory dir)
       #+sbcl (sb-posix:chdir dir)
       #+sbcl (setf default-pathname-defaults (sb-ext:native-pathname (format nil "~A~A" (sb-posix:getcwd) "/")))
       #+ccl (ccl:cwd dir)
       #+ecl (si:chdir dir)

       (namestring dir))))

This works good on many computers. On debian-testing unfortunately I get a message saying that the file cannot be loaded, instead. My guess is that chdir has been moved to si from a different package. But I am not sure about this.

Is there a way to change gcl's working directory without breaking things for one version of gcl or the other?

I've set the priority of this ticket to "important" as it affects multiple users. I hoe that is OK. If not please re-assign the severity at will.

Thanks a lot,


Gunter Königsmann <peterpall>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #39696: added by peterpall (63KiB - application/octet-stream - The whole file that cannot be loaded.)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by kvutza (Posted a comment)
  • -email is unavailable- added by peterpall (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-07 peterpall Attached File- => Added, #39696

    Back to the top

    Powered by Savane 3.5