From: "Thompson, David" <dthompson2@worcester.edu>
To: Alex Vong <alexvong1995@gmail.com>
Cc: Guile User <guile-user@gnu.org>, Chris Marusich <cmmarusich@gmail.com>
Subject: Re: How to get the preferred environment variable path separator?
Date: Mon, 28 Mar 2016 10:24:56 -0400 [thread overview]
Message-ID: <CAJ=RwfbT+JmFBZQNuegHNzT8+-10rv6-zasFO0Pf8Z+6x_dVJw@mail.gmail.com> (raw)
In-Reply-To: <87shzalnq0.fsf@gmail.com>
On Mon, Mar 28, 2016 at 9:46 AM, Alex Vong <alexvong1995@gmail.com> wrote:
> "Thompson, David" <dthompson2@worcester.edu> writes:
>
>> On Mon, Mar 28, 2016 at 6:00 AM, Alex Vong <alexvong1995@gmail.com> wrote:
>>> Hi,
>>>
>>> Chris Marusich <cmmarusich@gmail.com> writes:
>>>
>>>> Hi,
>>>>
>>>> Info node "(guile) File System" describes a procedure for getting the
>>>> preferred file name separator of the operating system:
>>>>
>>>> -- Scheme Variable: file-name-separator-string
>>>> The preferred file name separator.
>>>>
>>>> Note that on MinGW builds for Windows, both ‘/’ and ‘\’ are valid
>>>> separators. Thus, programs should not assume that
>>>> ‘file-name-separator-string’ is the _only_ file name
>>>> separator—e.g., when extracting the components of a file name.
>>>>
>>>>
>>>> Is there an equivalent procedure for getting the preferred environment
>>>> variable path separator, too? I would expect such a procedure to return
>>>> the ":" string (or does it return a character?) on most GNU/Linux
>>>> distributions, since that is the separator e.g. for the PATH environment
>>>> variable.
>>>>
>>> I can't find one either. If the machine has perl/python, you could try
>>> (use-modules (ice-9 rdelim) (ice-9 popen))
>>> (read-line (open-pipe* OPEN_READ
>>> "perl"
>>> "-e"
>>> "use Config; print $Config{path_sep}"))
>>> or
>>> (use-modules (ice-9 rdelim) (ice-9 popen))
>>> (read-line (open-pipe* OPEN_READ
>>> "python"
>>> "-c"
>>> "import os; print(os.pathsep)"))
>>
>> Please don't do this. Use file-name-separator-string. Section 7.2.3
>> in the manual, titled "File System". In Emacs, you can press 'i' to
>> search the manual for identifiers.
>>
>> Another way of finding out things like this is to use the REPL:
>>
>> scheme@(guile-user)> ,a separator
>> (guile): file-name-separator-string
>> (guile): file-name-separator? #<procedure file-name-separator? (c)>
>> scheme@(guile-user)> file-name-separator-string
>> $2 = "/"
>>
> I think Christ is asking for ":" instead of "/", do we have environment
> path separator in Guile?
Sorry, I misunderstood.
The environment variable path separator is *not* defined depending on
the OS. It is up to the programs that interpret these search paths to
specify what the separator should be. ":" is the most common
separator, but that is just convention. A search path is opaque to
the operating system, where environment variables are just strings
with no inherent meaning.
Hope this helps.
- Dave
next prev parent reply other threads:[~2016-03-28 14:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-28 0:42 How to get the preferred environment variable path separator? Chris Marusich
2016-03-28 10:00 ` Alex Vong
2016-03-28 12:20 ` Thompson, David
2016-03-28 13:46 ` Alex Vong
2016-03-28 14:24 ` Thompson, David [this message]
2016-03-28 15:36 ` Paul Smith
2016-03-28 15:36 ` Eli Zaretskii
2016-03-28 15:40 ` Thompson, David
2016-03-29 7:53 ` tomas
2016-03-31 4:38 ` Chris Marusich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAJ=RwfbT+JmFBZQNuegHNzT8+-10rv6-zasFO0Pf8Z+6x_dVJw@mail.gmail.com' \
--to=dthompson2@worcester.edu \
--cc=alexvong1995@gmail.com \
--cc=cmmarusich@gmail.com \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).