Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

** MAXIMUM TERMINALS ACTIVE. TRY AGAIN LATER **


devel / comp.lang.fortran / Re: Canonical file name

SubjectAuthor
* Canonical file nameJohn Collins
+* Re: Canonical file namegah4
|`* Re: Canonical file nameRon Shepard
| `- Re: Canonical file namegah4
`- Re: Canonical file namespectrum

1
Canonical file name

<8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=874&group=comp.lang.fortran#874

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:c709:: with SMTP id w9mr44602651qvi.37.1622046991498;
Wed, 26 May 2021 09:36:31 -0700 (PDT)
X-Received: by 2002:a25:7a02:: with SMTP id v2mr50584164ybc.514.1622046991341;
Wed, 26 May 2021 09:36:31 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 26 May 2021 09:36:31 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=51.9.239.8; posting-account=xDRY5QoAAAC2FYqWewp8nrpnVLhp0KxM
NNTP-Posting-Host: 51.9.239.8
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
Subject: Canonical file name
From: john.collins@simconglobal.com (John Collins)
Injection-Date: Wed, 26 May 2021 16:36:31 +0000
Content-Type: text/plain; charset="UTF-8"
 by: John Collins - Wed, 26 May 2021 16:36 UTC

Some compilers, e.g. ifort, Compaq Visual Fortran and VMS provide a complete file name, including the path and (Where appropriate) the device as the return NAME= argument to INQUIRE. These compilers interpret symbolic links and symbols.

Some compilers, e.g. Oracle/SUN Studio, gfortran and g95, only return the name passed as the FILE= argument. However it is usually possible to capture a complete file name and path using the C library routine realpath.

realpath is not supported under MacOS. Perhaps this is because a path may pass through case sensitive and case insensitive directories. Is there an alternative to realpath which would return a canonical file name under MacOS and gfortran?

Thank you for your help,

John

Re: Canonical file name

<06a2c93f-fda4-4453-aa6e-b2e1aa49d158n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=875&group=comp.lang.fortran#875

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a0c:ef90:: with SMTP id w16mr45849380qvr.28.1622059870863; Wed, 26 May 2021 13:11:10 -0700 (PDT)
X-Received: by 2002:a25:3f44:: with SMTP id m65mr51003797yba.254.1622059870140; Wed, 26 May 2021 13:11:10 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!4.us.feeder.erje.net!2.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 26 May 2021 13:11:09 -0700 (PDT)
In-Reply-To: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4979:eca5:9d78:ccef:7f00; posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4979:eca5:9d78:ccef:7f00
References: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <06a2c93f-fda4-4453-aa6e-b2e1aa49d158n@googlegroups.com>
Subject: Re: Canonical file name
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 26 May 2021 20:11:10 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 23
 by: gah4 - Wed, 26 May 2021 20:11 UTC

On Wednesday, May 26, 2021 at 9:36:33 AM UTC-7, john.c...@simconglobal.com wrote:

(snip)

> realpath is not supported under MacOS.

On my macOS Sierra machine, man realpath gives the manpage for it,
as with Linux, says it came from 4.4BSD.

I didn't try actually using it.

> Perhaps this is because a path may pass through case sensitive and
> case insensitive directories. Is there an alternative to realpath which would
> return a canonical file name under MacOS and gfortran?

I don't think that would be a problem. The case-insensitive HFS are still case
preserving.

But yes, lots of fun with different file systems. I run my OS X system with an
NFS mounted disk that I use for most of the files, which is case sensitive like
usual Unix disks. I have never had an actual problems caused by case, but
it is possible.

Re: Canonical file name

<EGQrI.176431$lyv9.39082@fx35.iad>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=876&group=comp.lang.fortran#876

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx35.iad.POSTED!not-for-mail
Subject: Re: Canonical file name
Newsgroups: comp.lang.fortran
References: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
<06a2c93f-fda4-4453-aa6e-b2e1aa49d158n@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.10.2
MIME-Version: 1.0
In-Reply-To: <06a2c93f-fda4-4453-aa6e-b2e1aa49d158n@googlegroups.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Lines: 44
Message-ID: <EGQrI.176431$lyv9.39082@fx35.iad>
X-Complaints-To: abuse@easynews.com
Organization: Forte - www.forteinc.com
X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.
Date: Thu, 27 May 2021 12:30:12 -0500
X-Received-Bytes: 3077
 by: Ron Shepard - Thu, 27 May 2021 17:30 UTC

On 5/26/21 3:11 PM, gah4 wrote:
> On Wednesday, May 26, 2021 at 9:36:33 AM UTC-7, john.c...@simconglobal.com wrote:
>
> (snip)
>
>> realpath is not supported under MacOS.
>
> On my macOS Sierra machine, man realpath gives the manpage for it,
> as with Linux, says it came from 4.4BSD.
>
> I didn't try actually using it.
>
>> Perhaps this is because a path may pass through case sensitive and
>> case insensitive directories. Is there an alternative to realpath which would
>> return a canonical file name under MacOS and gfortran?
>
> I don't think that would be a problem. The case-insensitive HFS are still case
> preserving.
>
> But yes, lots of fun with different file systems. I run my OS X system with an
> NFS mounted disk that I use for most of the files, which is case sensitive like
> usual Unix disks. I have never had an actual problems caused by case, but
> it is possible.

I don't know the answer to this question, but my guess is that this is
more of a shell function than an OS or file system function, so it might
be helpful to look at shell commands that perform the desired
translations and work back from there to see how they do it.

In MacOS, you can have several filesystems mounted simultaneously, some
of which are case sensitive and some of which aren't. When initializing
file systems, this is a standard option, so you can even have different
conventions on the same physical disk. And then you can have symbolic
links that go back and forth between them, and shell variables can be
defined that include multiple path steps between them, so there are
relatively few limitations on the possibilities. MacOS also supports the
usual hard links within a file system. There is also the MacOS Finder
alias facility, which is not exactly a hard link and not exactly a
symbolic link, but something in between. If you have to do all this
yourself, there are a lot of possibilities, so it would probably be best
to look at how your favorite shell does it and start from there.

$.02 -Ron Shepard

Re: Canonical file name

<2b0865ea-64ac-4952-a6ff-5ab6adf28560n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=877&group=comp.lang.fortran#877

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:ae9:dfc4:: with SMTP id t187mr892782qkf.0.1622155012849;
Thu, 27 May 2021 15:36:52 -0700 (PDT)
X-Received: by 2002:a25:a1e2:: with SMTP id a89mr7778995ybi.439.1622155012726;
Thu, 27 May 2021 15:36:52 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Thu, 27 May 2021 15:36:52 -0700 (PDT)
In-Reply-To: <EGQrI.176431$lyv9.39082@fx35.iad>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4979:d4ec:f258:9cec:ae4;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4979:d4ec:f258:9cec:ae4
References: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
<06a2c93f-fda4-4453-aa6e-b2e1aa49d158n@googlegroups.com> <EGQrI.176431$lyv9.39082@fx35.iad>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2b0865ea-64ac-4952-a6ff-5ab6adf28560n@googlegroups.com>
Subject: Re: Canonical file name
From: gah4@u.washington.edu (gah4)
Injection-Date: Thu, 27 May 2021 22:36:52 +0000
Content-Type: text/plain; charset="UTF-8"
 by: gah4 - Thu, 27 May 2021 22:36 UTC

On Thursday, May 27, 2021 at 10:30:17 AM UTC-7, Ron Shepard wrote:

(snip)
> I don't know the answer to this question, but my guess is that this is
> more of a shell function than an OS or file system function, so it might
> be helpful to look at shell commands that perform the desired
> translations and work back from there to see how they do it.

There is getcwd() to get the current working directory, to prepend to
any relative file name. It seems that realpath() also follows symbolic
links (that isn't so obvious), removes excess /, and also undoes /./
and /../ in the path.

Most shells, and programs that pretend to work like shells, also expand
a leading ~ as the user's home directory, or ~user as the home directory
of another user. Most programs that are not shells, or pretending to
be shells, don't do that, and it looks like realpath() also doens't do it.

In any case, since it comes from 4.4BSD, and is also in Linux, there should
be an open source version available.

But on my system, OS X has it already.

Re: Canonical file name

<5ac20324-13a2-4d43-a052-4eb19bda35c7n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=878&group=comp.lang.fortran#878

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:11c3:: with SMTP id n3mr2338069qtk.211.1622190340498;
Fri, 28 May 2021 01:25:40 -0700 (PDT)
X-Received: by 2002:a25:be05:: with SMTP id h5mr11384820ybk.187.1622190340314;
Fri, 28 May 2021 01:25:40 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Fri, 28 May 2021 01:25:39 -0700 (PDT)
In-Reply-To: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=240d:2:ad04:cf00:450e:62db:7a16:3154;
posting-account=5O224QoAAADRI1iWNtb6KadFFrmcll-8
NNTP-Posting-Host: 240d:2:ad04:cf00:450e:62db:7a16:3154
References: <8d0e8b36-5afc-4142-abae-cd34c0370afcn@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5ac20324-13a2-4d43-a052-4eb19bda35c7n@googlegroups.com>
Subject: Re: Canonical file name
From: septcolor7@gmail.com (spectrum)
Injection-Date: Fri, 28 May 2021 08:25:40 +0000
Content-Type: text/plain; charset="UTF-8"
 by: spectrum - Fri, 28 May 2021 08:25 UTC

On Thursday, May 27, 2021 at 1:36:33 AM UTC+9, john.c... wrote:
>
> realpath is not supported under MacOS.

I've searched the net with keywords "osx realpath", and there seem several
workarounds, e.g.

* realpath for OS X
https://github.com/harto/realpath-osx
# The subtitle is interesting :) (a.k.a. "the only useful C program I ever wrote")

* Use homebrew
$ brew install coreutils

But on my mac, "$ man realpath" shows some man page, so it might be
already available from other libraries or something (or possibly by default?)
https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/realpath.3.html

* Some other pages...
https://stackoverflow.com/questions/3572030/bash-script-absolute-path-with-os-x


devel / comp.lang.fortran / Re: Canonical file name

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor