guile-user
[Top][All Lists]
Advanced

[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 18:00:53 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

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)"))

> While we're on the topic, Guile's manual has a lot of very nice,
> detailed information about each module.  However, it does not seem to
> tell me what the name of the modules are.  Where can I find out what the
> name of any module described in the manual - e.g. the module which is
> described in the Info node "(guile) POSIX"?
I think the procedures described in (guile) POSIX are distributed in
different modules. E.g, `open-pipe' is located in `(ice-9 popen)', while
`chdir' is in the global namespace.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]