[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trouble using (current-filename)
From: |
Ludovic Courtès |
Subject: |
Re: Trouble using (current-filename) |
Date: |
Tue, 21 Feb 2012 21:52:53 +0100 |
User-agent: |
Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) |
Hi Neil!
Neil Jerram <address@hidden> skribis:
> Perhaps after all the right thing, for my use case, is something based
> on (car (command-line)) and (getcwd). I currently have this
> 'compatibility definition' for Guile 1.8.x:
>
> (define (current-filename)
> (let* ((script (car (command-line)))
> (scriptdir (dirname script))
> (absdir (cond ((string=? scriptdir ".")
> (getcwd))
> ((string-match "^/" scriptdir)
> scriptdir)
> (else
> (in-vicinity (getcwd) scriptdir)))))
> (in-vicinity scriptdir (basename script))))
>
> But maybe that's the better solution for 2.x as well.
Yes, for that case, you definitely want something that happens at
run-time, pretty much like $ORIGIN in ELF files.
Thanks,
Ludo’.
- Re: Trouble using (current-filename), (continued)
- Re: Trouble using (current-filename), Andy Wingo, 2012/02/16
- Re: Trouble using (current-filename), Ludovic Courtès, 2012/02/17
- Re: Trouble using (current-filename), Andy Wingo, 2012/02/18
- Re: Trouble using (current-filename), Ludovic Courtès, 2012/02/19
- Re: Trouble using (current-filename), Andy Wingo, 2012/02/19
- Re: Trouble using (current-filename), Ludovic Courtès, 2012/02/19
- Re: Trouble using (current-filename), Andy Wingo, 2012/02/19
- Re: Trouble using (current-filename), Noah Lavine, 2012/02/19
- Re: Trouble using (current-filename), Ludovic Courtès, 2012/02/20
- Re: Trouble using (current-filename), Neil Jerram, 2012/02/21
- Re: Trouble using (current-filename),
Ludovic Courtès <=
- Re: Trouble using (current-filename), Neil Jerram, 2012/02/21
Re: Trouble using (current-filename), Mark H Weaver, 2012/02/21