Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

After a number of decimal places, nobody gives a damn.


devel / comp.lang.fortran / Re: File not found

SubjectAuthor
* File not founddb
`* Re: File not foundDaniel Feenberg
 `* Re: File not founddb
  `* Re: File not founddb
   `* Re: File not foundArjen Markus
    +- Re: File not foundRon Shepard
    `- Re: File not foundgah4

1
File not found

<ucnakf$2nhfv$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: File not found
Date: Wed, 30 Aug 2023 13:53:51 +0200
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <ucnakf$2nhfv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 30 Aug 2023 11:53:51 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d3f6093c9c332570b410942def1c08c5";
logging-data="2868735"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX182kWdKhE8/Ex8NjoHLQ3nRKYfDUeSagTo="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:4n4tUOxzLdcJQz04xxVi90raVPw=
Content-Language: en-US
 by: db - Wed, 30 Aug 2023 11:53 UTC

I am working in three directories:
ownlib90/
home
work/

In ownlib90, I have written a function called iband.f90 which contains
the statement
OPEN (1,file='band.dat',status='old',action='read')
The source file compiles OK, and iband.o is in the archive file of
object files. I assumed that the data file data.dat should be in
the same directrory as the function that uses it, that is, ownlib90,
but this is apparently not the case.

In work/ I have a program that uses the function iband, and when I
run it, I get "file not found, band.dat". It works if I put the data
file into work/ but this is not convenient because I want to be able
to call iband from different directories.

So I put the data file into the home directory into its subdirectory
data/ and changed the OPEN statement to
OPEN (1,file='$home/data/band.dat',status='old',action='read')
I get the same error. I tried $HOME and ~/ but none of these works.

So, leaving the data file in home/data/, what should I put into the
Open statement?

--
Dieter Britz

Re: File not found

<3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:622a:246:b0:412:1eb7:9538 with SMTP id c6-20020a05622a024600b004121eb79538mr52623qtx.8.1693397989847;
Wed, 30 Aug 2023 05:19:49 -0700 (PDT)
X-Received: by 2002:a05:6a00:17a5:b0:68a:6082:2c54 with SMTP id
s37-20020a056a0017a500b0068a60822c54mr760283pfg.6.1693397989493; Wed, 30 Aug
2023 05:19:49 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 30 Aug 2023 05:19:48 -0700 (PDT)
In-Reply-To: <ucnakf$2nhfv$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2603:3005:b2a:c100:600c:d889:3fb5:c21a;
posting-account=UKzVQwoAAAC0p4fW4nFhSsDyRRVgSJiF
NNTP-Posting-Host: 2603:3005:b2a:c100:600c:d889:3fb5:c21a
References: <ucnakf$2nhfv$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
Subject: Re: File not found
From: feenberg@gmail.com (Daniel Feenberg)
Injection-Date: Wed, 30 Aug 2023 12:19:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2088
 by: Daniel Feenberg - Wed, 30 Aug 2023 12:19 UTC

On Wednesday, August 30, 2023 at 7:53:56 AM UTC-4, db wrote:
> I am working in three directories:
> ownlib90/
> home
> work/
>
> In ownlib90, I have written a function called iband.f90 which contains
> the statement
> OPEN (1,file='band.dat',status='old',action='read')
> The source file compiles OK, and iband.o is in the archive file of
> object files. I assumed that the data file data.dat should be in
> the same directrory as the function that uses it, that is, ownlib90,
> but this is apparently not the case.
The open statement looks in the current directory regardless of where the program executable is stored. Shell expansions (~,*,?) are not available. So probably you want to specify the full filepath as "/home/data/band.dat" but you might find that "../data/band.dat" also works, depending on what the current directory is.

Daniel Feenberg

Re: File not found

<ucneeg$2o506$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: Re: File not found
Date: Wed, 30 Aug 2023 14:58:55 +0200
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <ucneeg$2o506$1@dont-email.me>
References: <ucnakf$2nhfv$1@dont-email.me>
<3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 30 Aug 2023 12:58:56 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d3f6093c9c332570b410942def1c08c5";
logging-data="2888710"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4ilEi2tZfIM55aDO+tfsdO0Fc3rAyKOY="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:MAdsvYanI3c3FNcBEeD8N+oVQMM=
In-Reply-To: <3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
Content-Language: en-US
 by: db - Wed, 30 Aug 2023 12:58 UTC

On 30.08.2023 14.19, Daniel Feenberg wrote:
> On Wednesday, August 30, 2023 at 7:53:56 AM UTC-4, db wrote:
>> I am working in three directories:
>> ownlib90/
>> home
>> work/
>>
>> In ownlib90, I have written a function called iband.f90 which contains
>> the statement
>> OPEN (1,file='band.dat',status='old',action='read')
>> The source file compiles OK, and iband.o is in the archive file of
>> object files. I assumed that the data file data.dat should be in
>> the same directrory as the function that uses it, that is, ownlib90,
>> but this is apparently not the case.
> The open statement looks in the current directory regardless of where the program executable is stored. Shell expansions (~,*,?) are not available. So probably you want to specify the full filepath as "/home/data/band.dat" but you might find that "../data/band.dat" also works, depending on what the current directory is.
>
> Daniel Feenberg
Fortran runtime error: Cannot open file '/home/data/band.dat': No such
file or directory

In the directory I am in, I tried

~/rect2> ls /home/data

and get

ls: cannot access '/home/data': No such file or directory

So that is another variant that doesn't work.

ls ~/data

works, but not inside the OPEN statement.
What now?
--
Dieter Britz

Re: File not found

<ucneo0$2o5r2$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: dieterhansbritz@gmail.com (db)
Newsgroups: comp.lang.fortran
Subject: Re: File not found
Date: Wed, 30 Aug 2023 15:04:00 +0200
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <ucneo0$2o5r2$1@dont-email.me>
References: <ucnakf$2nhfv$1@dont-email.me>
<3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
<ucneeg$2o506$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 30 Aug 2023 13:04:00 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="d3f6093c9c332570b410942def1c08c5";
logging-data="2889570"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+BhKWcJeB2/tnOY+I72KAWt2h3n+hXkbI="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.13.0
Cancel-Lock: sha1:RVuqRuA8tYGKdGU5RIUeWFvu6gM=
In-Reply-To: <ucneeg$2o506$1@dont-email.me>
Content-Language: en-US
 by: db - Wed, 30 Aug 2023 13:04 UTC

On 30.08.2023 14.58, db wrote:
> On 30.08.2023 14.19, Daniel Feenberg wrote:
>> On Wednesday, August 30, 2023 at 7:53:56 AM UTC-4, db wrote:
>>> I am working in three directories:
>>> ownlib90/
>>> home
>>> work/
>>>
>>> In ownlib90, I have written a function called iband.f90 which contains
>>> the statement
>>> OPEN (1,file='band.dat',status='old',action='read')
>>> The source file compiles OK, and iband.o is in the archive file of
>>> object files. I assumed that the data file data.dat should be in
>>> the same directrory as the function that uses it, that is, ownlib90,
>>> but this is apparently not the case.
>> The open statement looks in the current directory regardless of where
>> the program executable is stored.  Shell expansions (~,*,?) are not
>> available. So probably you want to specify the full filepath as
>> "/home/data/band.dat" but you might find that "../data/band.dat" also
>> works, depending on what the current directory is.
>>
>> Daniel Feenberg
> Fortran runtime error: Cannot open file '/home/data/band.dat': No such
> file or directory
>
> In the directory I am in, I tried
>
> ~/rect2> ls /home/data
>
> and get
>
> ls: cannot access '/home/data': No such file or directory
>
> So that is another variant that doesn't work.
>
> ls ~/data
>
> works, but not inside the OPEN statement.
> What now?

I realised that i am the user db on /home/, so I put in
/home/db/data/band.dat and it finally works. Phew!
That doesn't explain why ~/ and $home/ don't, but
that's academic now.

--
Dieter Britz

Re: File not found

<ab872994-bb33-4060-b76c-4b3a6d739949n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:162a:b0:63c:ebe9:2467 with SMTP id e10-20020a056214162a00b0063cebe92467mr68642qvw.13.1693405784769;
Wed, 30 Aug 2023 07:29:44 -0700 (PDT)
X-Received: by 2002:a05:620a:900b:b0:76f:2631:caa3 with SMTP id
rk11-20020a05620a900b00b0076f2631caa3mr54012qkn.2.1693405784511; Wed, 30 Aug
2023 07:29:44 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 30 Aug 2023 07:29:44 -0700 (PDT)
In-Reply-To: <ucneo0$2o5r2$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=62.194.189.128; posting-account=A91wAAoAAADgBUxBX6QqsrSD26GLhVp8
NNTP-Posting-Host: 62.194.189.128
References: <ucnakf$2nhfv$1@dont-email.me> <3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
<ucneeg$2o506$1@dont-email.me> <ucneo0$2o5r2$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ab872994-bb33-4060-b76c-4b3a6d739949n@googlegroups.com>
Subject: Re: File not found
From: arjen.markus895@gmail.com (Arjen Markus)
Injection-Date: Wed, 30 Aug 2023 14:29:44 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3301
 by: Arjen Markus - Wed, 30 Aug 2023 14:29 UTC

On Wednesday, August 30, 2023 at 3:04:05 PM UTC+2, db wrote:
> On 30.08.2023 14.58, db wrote:
> > On 30.08.2023 14.19, Daniel Feenberg wrote:
> >> On Wednesday, August 30, 2023 at 7:53:56 AM UTC-4, db wrote:
> >>> I am working in three directories:
> >>> ownlib90/
> >>> home
> >>> work/
> >>>
> >>> In ownlib90, I have written a function called iband.f90 which contains
> >>> the statement
> >>> OPEN (1,file='band.dat',status='old',action='read')
> >>> The source file compiles OK, and iband.o is in the archive file of
> >>> object files. I assumed that the data file data.dat should be in
> >>> the same directrory as the function that uses it, that is, ownlib90,
> >>> but this is apparently not the case.
> >> The open statement looks in the current directory regardless of where
> >> the program executable is stored. Shell expansions (~,*,?) are not
> >> available. So probably you want to specify the full filepath as
> >> "/home/data/band.dat" but you might find that "../data/band.dat" also
> >> works, depending on what the current directory is.
> >>
> >> Daniel Feenberg
> > Fortran runtime error: Cannot open file '/home/data/band.dat': No such
> > file or directory
> >
> > In the directory I am in, I tried
> >
> > ~/rect2> ls /home/data
> >
> > and get
> >
> > ls: cannot access '/home/data': No such file or directory
> >
> > So that is another variant that doesn't work.
> >
> > ls ~/data
> >
> > works, but not inside the OPEN statement.
> > What now?
> I realised that i am the user db on /home/, so I put in
> /home/db/data/band.dat and it finally works. Phew!
> That doesn't explain why ~/ and $home/ don't, but
> that's academic now.
>
> --
> Dieter Britz
Tilde expansion and environment variables are properties of the shell that you use. They are not automatically expanded within a program ;).

Regards,

Arjen

Re: File not found

<mFJHM.669732$TCKc.125981@fx13.iad>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx13.iad.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:102.0)
Gecko/20100101 Thunderbird/102.14.0
Subject: Re: File not found
Content-Language: en-US
Newsgroups: comp.lang.fortran
References: <ucnakf$2nhfv$1@dont-email.me>
<3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
<ucneeg$2o506$1@dont-email.me> <ucneo0$2o5r2$1@dont-email.me>
<ab872994-bb33-4060-b76c-4b3a6d739949n@googlegroups.com>
From: nospam@nowhere.org (Ron Shepard)
In-Reply-To: <ab872994-bb33-4060-b76c-4b3a6d739949n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 13
Message-ID: <mFJHM.669732$TCKc.125981@fx13.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: Wed, 30 Aug 2023 10:57:06 -0500
X-Received-Bytes: 1734
 by: Ron Shepard - Wed, 30 Aug 2023 15:57 UTC

On 8/30/23 9:29 AM, Arjen Markus wrote:
> Tilde expansion and environment variables are properties of the shell that you use. They are not automatically expanded within a program ;).

A fortran programmer can do the expansion using the standard intrinsic
function GET_ENVIRONMENT_VARIABLE(). Here is the gfortran description,
which coincidentally includes an example with the HOME variable.

https://gcc.gnu.org/onlinedocs/gfortran/GET_005fENVIRONMENT_005fVARIABLE.html

You would generally combine the returned value with the filename to get
the full path name, and then use that in the fortran open statement.

$.02 -Ron Shepard

Re: File not found

<0c19b7f5-3613-4442-a126-6db489836824n@googlegroups.com>

  copy mid

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

  copy link   Newsgroups: comp.lang.fortran
X-Received: by 2002:a05:6214:90a:b0:63f:be4f:160a with SMTP id dj10-20020a056214090a00b0063fbe4f160amr7338qvb.3.1693413575295;
Wed, 30 Aug 2023 09:39:35 -0700 (PDT)
X-Received: by 2002:a05:6a00:17a0:b0:68b:dbad:7ae7 with SMTP id
s32-20020a056a0017a000b0068bdbad7ae7mr1024655pfg.6.1693413575038; Wed, 30 Aug
2023 09:39:35 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.fortran
Date: Wed, 30 Aug 2023 09:39:34 -0700 (PDT)
In-Reply-To: <ab872994-bb33-4060-b76c-4b3a6d739949n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2601:602:9700:4689:4c34:b8ed:f322:cf32;
posting-account=gLDX1AkAAAA26M5HM-O3sVMAXdxK9FPA
NNTP-Posting-Host: 2601:602:9700:4689:4c34:b8ed:f322:cf32
References: <ucnakf$2nhfv$1@dont-email.me> <3050bd2a-9d49-4087-8af0-6c2ca2e4e62fn@googlegroups.com>
<ucneeg$2o506$1@dont-email.me> <ucneo0$2o5r2$1@dont-email.me> <ab872994-bb33-4060-b76c-4b3a6d739949n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <0c19b7f5-3613-4442-a126-6db489836824n@googlegroups.com>
Subject: Re: File not found
From: gah4@u.washington.edu (gah4)
Injection-Date: Wed, 30 Aug 2023 16:39:35 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2051
 by: gah4 - Wed, 30 Aug 2023 16:39 UTC

On Wednesday, August 30, 2023 at 7:29:47 AM UTC-7, Arjen Markus wrote:

(snip)

> Tilde expansion and environment variables are properties of the shell that you use. They are not automatically expanded within a program ;).
A few programs, other than shells, also do it.

Both ~/ and $HOME also work in commands inside vi (and vim).
I suspect also in some other popular Unix-like editors.

Some programs also use specific environment variables for finding files.

AWK has AWKPATH for a path (list of directories) to search for program files.

In all those cases, it is done specifically by the program, not automatically
by the I/O library routines.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor