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: NonePriority: 5 - Normal
Severity: 4 - ImportantStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenOperating 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.

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 File(s):
   
   
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
  • -unavailable- added by kvutza (Posted a comment)
  • -unavailable- added by peterpall (Submitted the item)
  •  

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

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 07 Feb 2017 08:13:56 PM UTCpeterpallAttached File-=>Added wxmathml.lisp.in, #39696

    Back to the top


    Powered by Savane 3.1-cleanup1