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

 
 

sr #109250: How to change the current directory

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

Add a New Comment Rich Markup
   

Fri 24 Dec 2021 11:57:35 PM UTC, comment #4: 

Thanks so much for your report!

Camm Maguire <camm>
Group administrator
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.

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.

Gunter Königsmann <peterpall>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #39696:  wxmathml.lisp.in 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 camm (Posted a comment)
  • -email is unavailable- added by kvutza (Posted a comment)
  • -email is unavailable- added by peterpall (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-24 camm StatusNone Done
        Open/ClosedOpen Closed
    2017-02-07 peterpall Attached File- Added wxmathml.lisp.in, #39696

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code