[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get the preferred environment variable path separator?
From: |
Alex Vong |
Subject: |
Re: How to get the preferred environment variable path separator? |
Date: |
Mon, 28 Mar 2016 21:46:15 +0800 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) |
"Thompson, David" <address@hidden> writes:
> On Mon, Mar 28, 2016 at 6:00 AM, Alex Vong <address@hidden> wrote:
>> Hi,
>>
>> Chris Marusich <address@hidden> 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?
>
> - Dave
- How to get the preferred environment variable path separator?, Chris Marusich, 2016/03/28
- Re: How to get the preferred environment variable path separator?, Alex Vong, 2016/03/28
- Re: How to get the preferred environment variable path separator?, Thompson, David, 2016/03/28
- Re: How to get the preferred environment variable path separator?,
Alex Vong <=
- Re: How to get the preferred environment variable path separator?, Thompson, David, 2016/03/28
- Re: How to get the preferred environment variable path separator?, Eli Zaretskii, 2016/03/28
- Re: How to get the preferred environment variable path separator?, Thompson, David, 2016/03/28
- Re: How to get the preferred environment variable path separator?, tomas, 2016/03/29
- Re: How to get the preferred environment variable path separator?, Paul Smith, 2016/03/28
- Re: How to get the preferred environment variable path separator?, Chris Marusich, 2016/03/31