Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

God made the integers; all else is the work of Man. -- Kronecker


computers / comp.os.vms / Re: Style question, was: Re: Empty blocks in FILES-11 directory files.

SubjectAuthor
* Empty blocks in FILES-11 directory files.Mark Daniel
+* Re: Empty blocks in FILES-11 directory files.abrsvc
|`- Re: Empty blocks in FILES-11 directory files.Johnny Billquist
+* Re: Empty blocks in FILES-11 directory files.Mark Daniel
|`* Re: Empty blocks in FILES-11 directory files.abrsvc
| `* Re: Empty blocks in FILES-11 directory files.Volker Halle
|  +- Re: Empty blocks in FILES-11 directory files.Volker Halle
|  +* Re: Empty blocks in FILES-11 directory files.Mark Daniel
|  |+* Re: Empty blocks in FILES-11 directory files.Volker Halle
|  ||+* Re: Empty blocks in FILES-11 directory files.David Jones
|  |||+- Re: Empty blocks in FILES-11 directory files.Bob Gezelter
|  |||`- Re: Empty blocks in FILES-11 directory files.Volker Halle
|  ||`- Re: Empty blocks in FILES-11 directory files.Mark Daniel
|  |+* Re: Empty blocks in FILES-11 directory files.Johnny Billquist
|  ||+- Re: Empty blocks in FILES-11 directory files.Volker Halle
|  ||`- Re: Empty blocks in FILES-11 directory files.Arne Vajhøj
|  |`* Style question, was: Re: Empty blocks in FILES-11 directory files.Simon Clubley
|  | +- Re: Style question, was: Re: Empty blocks in FILES-11 directory files.Dennis Boone
|  | `- Re: Style question, was: Re: Empty blocks in FILES-11 directoryArne Vajhøj
|  `- Re: Empty blocks in FILES-11 directory files.Mark Daniel
`* Re: Empty blocks in FILES-11 directory files.Oswald Knoppers
 `- Re: Empty blocks in FILES-11 directory files.Volker Halle

1
Empty blocks in FILES-11 directory files.

<Q9HXK.514313$14z3.96406@fx11.ams4>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25012&group=comp.os.vms#25012

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx11.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.3.0
From: mark.dan...@wasd.vsm.com.au (Mark Daniel)
Subject: Empty blocks in FILES-11 directory files.
Newsgroups: comp.os.vms
Content-Language: en-US
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 39
Message-ID: <Q9HXK.514313$14z3.96406@fx11.ams4>
X-Complaints-To: abuse@eweka.nl
NNTP-Posting-Date: Sat, 24 Sep 2022 17:31:28 UTC
Organization: Eweka Internet Services
Date: Sun, 25 Sep 2022 03:01:27 +0930
X-Received-Bytes: 2275
 by: Mark Daniel - Sat, 24 Sep 2022 17:31 UTC

It seems as if directory blocks containing zero file entry records, and
subrecords, tend to accumulate in active directories. Can only assume
these arise when multi-multi-multiversion consecutive file names are
deleted from the directory. Recently encountered 32 consecutive empty
blocks at which my code sanity checked.

Quick solution; create an equivalent directory and copy from the
original to the new. Problem Solvered. Assume a backup-restore would
accomplish similar, etc.

Questions:

Is this expected directory file behaviour?

Do these empty blocks continue to accumulate, only to be reused should
in-order file names be created?

Do extensive empty directory blocks represent tangible overhead to the
(persumably) XQP? (My code sanity checked at 32 but who knows exactly
how many there really were.)

Are their tools to measure such directory file efficiency (shall we say)
and to "compress" such files (apart from backup-restore).

TIA, Mark.

PS. I do recall descriptions of the FILES-11 directory internals being
very simple-minded and inefficient.

PPS. My entire technical hard-copy collection, including such VMS tomes
as McCoy's File System Internals, in a fit of pique, went into a recycle
bin some years ago. Moral of the story; don't let line-management get
under your skin.

--
Anyone, who using social-media, forms an opinion regarding anything
other than the relative cuteness of this or that puppy-dog, needs
seriously to examine their critical thinking.

Re: Empty blocks in FILES-11 directory files.

<584fbe65-d20f-494a-95c5-eb4a5f2af7e3n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25013&group=comp.os.vms#25013

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ae9:c103:0:b0:6ce:1a9f:9f76 with SMTP id z3-20020ae9c103000000b006ce1a9f9f76mr9571052qki.306.1664041320581;
Sat, 24 Sep 2022 10:42:00 -0700 (PDT)
X-Received: by 2002:a05:620a:4155:b0:6ce:3e56:c1e5 with SMTP id
k21-20020a05620a415500b006ce3e56c1e5mr9538183qko.350.1664041320445; Sat, 24
Sep 2022 10:42:00 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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.os.vms
Date: Sat, 24 Sep 2022 10:42:00 -0700 (PDT)
In-Reply-To: <Q9HXK.514313$14z3.96406@fx11.ams4>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:4040:5ed8:3d00:bc58:bdf0:1d9:f075;
posting-account=Ysq9BAoAAACGX1EcMMPkdNg4YcTg0TxG
NNTP-Posting-Host: 2600:4040:5ed8:3d00:bc58:bdf0:1d9:f075
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <584fbe65-d20f-494a-95c5-eb4a5f2af7e3n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: dansabrs...@yahoo.com (abrsvc)
Injection-Date: Sat, 24 Sep 2022 17:42:00 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3458
 by: abrsvc - Sat, 24 Sep 2022 17:42 UTC

On Saturday, September 24, 2022 at 1:31:31 PM UTC-4, Mark Daniel wrote:
> It seems as if directory blocks containing zero file entry records, and
> subrecords, tend to accumulate in active directories. Can only assume
> these arise when multi-multi-multiversion consecutive file names are
> deleted from the directory. Recently encountered 32 consecutive empty
> blocks at which my code sanity checked.
>
> Quick solution; create an equivalent directory and copy from the
> original to the new. Problem Solvered. Assume a backup-restore would
> accomplish similar, etc.
>
> Questions:
>
> Is this expected directory file behaviour?
>
> Do these empty blocks continue to accumulate, only to be reused should
> in-order file names be created?
>
> Do extensive empty directory blocks represent tangible overhead to the
> (persumably) XQP? (My code sanity checked at 32 but who knows exactly
> how many there really were.)
>
> Are their tools to measure such directory file efficiency (shall we say)
> and to "compress" such files (apart from backup-restore).
>
> TIA, Mark.
>
> PS. I do recall descriptions of the FILES-11 directory internals being
> very simple-minded and inefficient.
>
> PPS. My entire technical hard-copy collection, including such VMS tomes
> as McCoy's File System Internals, in a fit of pique, went into a recycle
> bin some years ago. Moral of the story; don't let line-management get
> under your skin.
>
> --
> Anyone, who using social-media, forms an opinion regarding anything
> other than the relative cuteness of this or that puppy-dog, needs
> seriously to examine their critical thinking.

It is my understanding that empty blocks will cause a shuffle of the entries that follow filling the block*. Empty blocks should only exist at the end of the directory file. Since directories are/must be contiguous, these trailing blocks will be used as space is required. I don't believe that the extra allocated blocks is a performance hit.

* This is why deleting large numbers of files in reverse order is so much faster as all that shuffling is avoided.

Dan

Re: Empty blocks in FILES-11 directory files.

<tgnpmo$ia2$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25016&group=comp.os.vms#25016

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.77-58-244-66.dclient.hispeed.ch!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: Empty blocks in FILES-11 directory files.
Date: Sat, 24 Sep 2022 22:35:35 +0200
Organization: MGT Consulting
Message-ID: <tgnpmo$ia2$1@news.misty.com>
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<584fbe65-d20f-494a-95c5-eb4a5f2af7e3n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 24 Sep 2022 20:35:36 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="77-58-244-66.dclient.hispeed.ch:77.58.244.66";
logging-data="18754"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.13.0
Content-Language: en-US
In-Reply-To: <584fbe65-d20f-494a-95c5-eb4a5f2af7e3n@googlegroups.com>
 by: Johnny Billquist - Sat, 24 Sep 2022 20:35 UTC

On 2022-09-24 19:42, abrsvc wrote:
> On Saturday, September 24, 2022 at 1:31:31 PM UTC-4, Mark Daniel wrote:
>> It seems as if directory blocks containing zero file entry records, and
>> subrecords, tend to accumulate in active directories. Can only assume
>> these arise when multi-multi-multiversion consecutive file names are
>> deleted from the directory. Recently encountered 32 consecutive empty
>> blocks at which my code sanity checked.
>>
>> Quick solution; create an equivalent directory and copy from the
>> original to the new. Problem Solvered. Assume a backup-restore would
>> accomplish similar, etc.
>>
>> Questions:
>>
>> Is this expected directory file behaviour?
>>
>> Do these empty blocks continue to accumulate, only to be reused should
>> in-order file names be created?
>>
>> Do extensive empty directory blocks represent tangible overhead to the
>> (persumably) XQP? (My code sanity checked at 32 but who knows exactly
>> how many there really were.)
>>
>> Are their tools to measure such directory file efficiency (shall we say)
>> and to "compress" such files (apart from backup-restore).
>>
>> TIA, Mark.
>>
>> PS. I do recall descriptions of the FILES-11 directory internals being
>> very simple-minded and inefficient.
>>
>> PPS. My entire technical hard-copy collection, including such VMS tomes
>> as McCoy's File System Internals, in a fit of pique, went into a recycle
>> bin some years ago. Moral of the story; don't let line-management get
>> under your skin.
>>
>> --
>> Anyone, who using social-media, forms an opinion regarding anything
>> other than the relative cuteness of this or that puppy-dog, needs
>> seriously to examine their critical thinking.
>
> It is my understanding that empty blocks will cause a shuffle of the entries that follow filling the block*. Empty blocks should only exist at the end of the directory file. Since directories are/must be contiguous, these trailing blocks will be used as space is required. I don't believe that the extra allocated blocks is a performance hit.
>
> * This is why deleting large numbers of files in reverse order is so much faster as all that shuffling is avoided.

What? Does directory files really need to be contiguous? I would be very
surprised by that. But directories in VMS are always sorted. I can see
that a delete might leave an empty space, but chances are high that when
you enter something new, it would need resorting and shuffling the
directory, so I wouldn't expect you to constantly see large empty spaces
in a directory under VMS.
Or ODS-2 I should say. Under ODS-1, you can have large empty chunks in a
directory, since it does not keep files sorted in the first place. ODS-1
also definitely do not require directories to be contiguous.

I would suspect ODS-5 to be rather similar to ODS-2 here, but don't know
for sure.

Johnny

Re: Empty blocks in FILES-11 directory files.

<qGMXK.504537$nwq3.138903@fx13.ams4>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25020&group=comp.os.vms#25020

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx13.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.3.0
Subject: Re: Empty blocks in FILES-11 directory files.
Newsgroups: comp.os.vms
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
Content-Language: en-US
From: mark.dan...@wasd.vsm.com.au (Mark Daniel)
In-Reply-To: <Q9HXK.514313$14z3.96406@fx11.ams4>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 62
Message-ID: <qGMXK.504537$nwq3.138903@fx13.ams4>
X-Complaints-To: abuse@eweka.nl
NNTP-Posting-Date: Sat, 24 Sep 2022 23:47:34 UTC
Organization: Eweka Internet Services
Date: Sun, 25 Sep 2022 09:17:33 +0930
X-Received-Bytes: 3507
 by: Mark Daniel - Sat, 24 Sep 2022 23:47 UTC

I'll just refine my query in the bright light of the new day.

Dan has clarified the "Empty blocks should only exist at the end of the
directory file". I seem to recall this shuffle myself. Can someone
point to, or reference a resource which confirms this definitely. This
would mean my code could quit after the first empty block encountered
without continuing on to EOF. This also would imply that without
intervention, directory files will not shrink, only grow in size.

PS. There are a number of resources out there that do not seem to
clarify the issue of these zeroed blocks. (Links posted as quotations
to stop them being broken.)

> http://www.bitsavers.org/pdf/dec/vax/vms/training/EY-F575E-DP_VMS_File_System_Internals_1990.pdf
> https://web-docs.gsi.de/~kraemer/COLLECTION/VMS/ods2.txt
> https://groups.google.com/g/comp.os.vms/c/SU2YvPOeowo

and an interesting (but not immediately relevant) first-person recollection

> https://www.youtube.com/watch?v=b0YenelPw-Y

On 25/9/2022 3:01 am, Mark Daniel wrote:
> It seems as if directory blocks containing zero file entry records, and
> subrecords, tend to accumulate in active directories.  Can only assume
> these arise when multi-multi-multiversion consecutive file names are
> deleted from the directory.  Recently encountered 32 consecutive empty
> blocks at which my code sanity checked.
>
> Quick solution; create an equivalent directory and copy from the
> original to the new.  Problem Solvered.  Assume a backup-restore would
> accomplish similar, etc.
>
> Questions:
>
> Is this expected directory file behaviour?
>
> Do these empty blocks continue to accumulate, only to be reused should
> in-order file names be created?
>
> Do extensive empty directory blocks represent tangible overhead to the
> (persumably) XQP?  (My code sanity checked at 32 but who knows exactly
> how many there really were.)
>
> Are their tools to measure such directory file efficiency (shall we say)
> and to "compress" such files (apart from backup-restore).
>
> TIA, Mark.
>
> PS. I do recall descriptions of the FILES-11 directory internals being
> very simple-minded and inefficient.
>
> PPS. My entire technical hard-copy collection, including such VMS tomes
> as McCoy's File System Internals, in a fit of pique, went into a recycle
> bin some years ago.  Moral of the story; don't let line-management get
> under your skin.

--
Anyone, who using social-media, forms an opinion regarding anything
other than the relative cuteness of this or that puppy-dog, needs
seriously to examine their critical thinking.

Re: Empty blocks in FILES-11 directory files.

<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25021&group=comp.os.vms#25021

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:5c91:0:b0:35b:bc2d:527 with SMTP id r17-20020ac85c91000000b0035bbc2d0527mr12764225qta.674.1664063524014;
Sat, 24 Sep 2022 16:52:04 -0700 (PDT)
X-Received: by 2002:a05:6214:234f:b0:4ad:6637:6f23 with SMTP id
hu15-20020a056214234f00b004ad66376f23mr12199776qvb.16.1664063523834; Sat, 24
Sep 2022 16:52:03 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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.os.vms
Date: Sat, 24 Sep 2022 16:52:03 -0700 (PDT)
In-Reply-To: <qGMXK.504537$nwq3.138903@fx13.ams4>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:4040:5ed8:3d00:bc58:bdf0:1d9:f075;
posting-account=Ysq9BAoAAACGX1EcMMPkdNg4YcTg0TxG
NNTP-Posting-Host: 2600:4040:5ed8:3d00:bc58:bdf0:1d9:f075
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: dansabrs...@yahoo.com (abrsvc)
Injection-Date: Sat, 24 Sep 2022 23:52:04 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 4272
 by: abrsvc - Sat, 24 Sep 2022 23:52 UTC

On Saturday, September 24, 2022 at 7:47:38 PM UTC-4, Mark Daniel wrote:
> I'll just refine my query in the bright light of the new day.
>
> Dan has clarified the "Empty blocks should only exist at the end of the
> directory file". I seem to recall this shuffle myself. Can someone
> point to, or reference a resource which confirms this definitely. This
> would mean my code could quit after the first empty block encountered
> without continuing on to EOF. This also would imply that without
> intervention, directory files will not shrink, only grow in size.
>
> PS. There are a number of resources out there that do not seem to
> clarify the issue of these zeroed blocks. (Links posted as quotations
> to stop them being broken.)
>
> > http://www.bitsavers.org/pdf/dec/vax/vms/training/EY-F575E-DP_VMS_File_System_Internals_1990.pdf
> > https://web-docs.gsi.de/~kraemer/COLLECTION/VMS/ods2.txt
> > https://groups.google.com/g/comp.os.vms/c/SU2YvPOeowo
>
> and an interesting (but not immediately relevant) first-person recollection
>
> > https://www.youtube.com/watch?v=b0YenelPw-Y
> On 25/9/2022 3:01 am, Mark Daniel wrote:
> > It seems as if directory blocks containing zero file entry records, and
> > subrecords, tend to accumulate in active directories. Can only assume
> > these arise when multi-multi-multiversion consecutive file names are
> > deleted from the directory. Recently encountered 32 consecutive empty
> > blocks at which my code sanity checked.
> >
> > Quick solution; create an equivalent directory and copy from the
> > original to the new. Problem Solvered. Assume a backup-restore would
> > accomplish similar, etc.
> >
> > Questions:
> >
> > Is this expected directory file behaviour?
> >
> > Do these empty blocks continue to accumulate, only to be reused should
> > in-order file names be created?
> >
> > Do extensive empty directory blocks represent tangible overhead to the
> > (persumably) XQP? (My code sanity checked at 32 but who knows exactly
> > how many there really were.)
> >
> > Are their tools to measure such directory file efficiency (shall we say)
> > and to "compress" such files (apart from backup-restore).
> >
> > TIA, Mark.
> >
> > PS. I do recall descriptions of the FILES-11 directory internals being
> > very simple-minded and inefficient.
> >
> > PPS. My entire technical hard-copy collection, including such VMS tomes
> > as McCoy's File System Internals, in a fit of pique, went into a recycle
> > bin some years ago. Moral of the story; don't let line-management get
> > under your skin.
>
> --
> Anyone, who using social-media, forms an opinion regarding anything
> other than the relative cuteness of this or that puppy-dog, needs
> seriously to examine their critical thinking.
To be honest, I don't know if the contiguous requirement is still valid. I got that from the Mccoy book. I will check further and look for the "end" record for the entire directory file. I assume that there is one.

Dan

Re: Empty blocks in FILES-11 directory files.

<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25029&group=comp.os.vms#25029

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:c9b:b0:6cb:cde2:27b5 with SMTP id q27-20020a05620a0c9b00b006cbcde227b5mr10652570qki.293.1664091111052;
Sun, 25 Sep 2022 00:31:51 -0700 (PDT)
X-Received: by 2002:a05:622a:1451:b0:35c:c676:1471 with SMTP id
v17-20020a05622a145100b0035cc6761471mr13245099qtx.634.1664091110818; Sun, 25
Sep 2022 00:31:50 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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.os.vms
Date: Sun, 25 Sep 2022 00:31:50 -0700 (PDT)
In-Reply-To: <64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c0:8f1b:ac01:b8b9:753a:6b16:d459;
posting-account=cHmS7AoAAACMYAFH9kP9m4l8qjrXLvte
NNTP-Posting-Host: 2003:c0:8f1b:ac01:b8b9:753a:6b16:d459
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: volker_h...@hotmail.com (Volker Halle)
Injection-Date: Sun, 25 Sep 2022 07:31:51 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2315
 by: Volker Halle - Sun, 25 Sep 2022 07:31 UTC

Mark,

does your utility read until the 'End of file block' or the 'Highest block' of the directory file ?

Free blocks should only be at the end of the directory file - after the EFBLK.

The logical end of the directory would be the last 'directory record' in the 'End of file block' of the directory file, i.e. a directory record with DIR$W_SIZE=-1 marks the end of directory records in the current block and therefore the end of the directory in the 'End of file block'

$ DUMP/DIR directory_file.DIR should show the last record as: 'xxx End of records (-1)' in the EOF block.

The function to 'shuffle' a directory (extend or compress) is called SHUFFLE_DIR, found in module [F11X]SHFDIR

Directory files are and must be contiguous. DUMP/HEADER directory.DIR shows:

File characteristics: Contiguous, Directory

This allows more efficient reads/writes and prevents window turns, when already executing inside the XQP.

Volker.

Re: Empty blocks in FILES-11 directory files.

<5751611d-1efd-4171-982c-23ebe773661an@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25030&group=comp.os.vms#25030

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:2043:b0:6ce:6035:9f51 with SMTP id d3-20020a05620a204300b006ce60359f51mr10850167qka.18.1664091953649;
Sun, 25 Sep 2022 00:45:53 -0700 (PDT)
X-Received: by 2002:a05:622a:1790:b0:35c:8450:d9e4 with SMTP id
s16-20020a05622a179000b0035c8450d9e4mr13514542qtk.130.1664091953443; Sun, 25
Sep 2022 00:45:53 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sun, 25 Sep 2022 00:45:53 -0700 (PDT)
In-Reply-To: <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c0:8f1b:ac01:b8b9:753a:6b16:d459;
posting-account=cHmS7AoAAACMYAFH9kP9m4l8qjrXLvte
NNTP-Posting-Host: 2003:c0:8f1b:ac01:b8b9:753a:6b16:d459
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <5751611d-1efd-4171-982c-23ebe773661an@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: volker_h...@hotmail.com (Volker Halle)
Injection-Date: Sun, 25 Sep 2022 07:45:53 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 8
 by: Volker Halle - Sun, 25 Sep 2022 07:45 UTC

Additions:

When compressing a directory file, EFBLK will be updated, but the blocks between EFBLK+1 and the highest block allocated will not be overwritten with zeroes, even if 'file high-water marking' is set.

$ CREATE/DIR/ALLOC=nnn will create .DIR file with zeroed blocks after EFBLK (if 'file high-water marking' is set).

Mark, what is your definition of 'empty blocks' - all zeroes ?

Volker.

Re: Empty blocks in FILES-11 directory files.

<8f5106ac-dd4b-4e8f-be24-0a3400650a49n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25031&group=comp.os.vms#25031

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a37:790:0:b0:6cb:ebb2:2bd4 with SMTP id 138-20020a370790000000b006cbebb22bd4mr10920601qkh.612.1664094025521;
Sun, 25 Sep 2022 01:20:25 -0700 (PDT)
X-Received: by 2002:a05:6214:20cb:b0:4a6:6fc5:616b with SMTP id
11-20020a05621420cb00b004a66fc5616bmr13437506qve.119.1664094025328; Sun, 25
Sep 2022 01:20:25 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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.os.vms
Date: Sun, 25 Sep 2022 01:20:25 -0700 (PDT)
In-Reply-To: <Q9HXK.514313$14z3.96406@fx11.ams4>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:58:199:9000:6f81:5ee4:1f56:4ef2;
posting-account=RRda-QoAAABEpXtVBlPh7pn5u99E081Q
NNTP-Posting-Host: 2a02:58:199:9000:6f81:5ee4:1f56:4ef2
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8f5106ac-dd4b-4e8f-be24-0a3400650a49n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: oswald.k...@gmail.com (Oswald Knoppers)
Injection-Date: Sun, 25 Sep 2022 08:20:25 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2966
 by: Oswald Knoppers - Sun, 25 Sep 2022 08:20 UTC

Op zaterdag 24 september 2022 om 19:31:31 UTC+2 schreef Mark Daniel:
> It seems as if directory blocks containing zero file entry records, and
> subrecords, tend to accumulate in active directories. Can only assume
> these arise when multi-multi-multiversion consecutive file names are
> deleted from the directory. Recently encountered 32 consecutive empty
> blocks at which my code sanity checked.
>
> Quick solution; create an equivalent directory and copy from the
> original to the new. Problem Solvered. Assume a backup-restore would
> accomplish similar, etc.
>
> Questions:
>
> Is this expected directory file behaviour?
>
> Do these empty blocks continue to accumulate, only to be reused should
> in-order file names be created?
>
> Do extensive empty directory blocks represent tangible overhead to the
> (persumably) XQP? (My code sanity checked at 32 but who knows exactly
> how many there really were.)
>
> Are their tools to measure such directory file efficiency (shall we say)
> and to "compress" such files (apart from backup-restore).
>
> TIA, Mark.
>
> PS. I do recall descriptions of the FILES-11 directory internals being
> very simple-minded and inefficient.
>
> PPS. My entire technical hard-copy collection, including such VMS tomes
> as McCoy's File System Internals, in a fit of pique, went into a recycle
> bin some years ago. Moral of the story; don't let line-management get
> under your skin.
>
> --
> Anyone, who using social-media, forms an opinion regarding anything
> other than the relative cuteness of this or that puppy-dog, needs
> seriously to examine their critical thinking.

You can install dfu (https://www.digiater.nl/dfu.html). This utility has an option to compress directory files.

Oswald

Re: Empty blocks in FILES-11 directory files.

<cfb93483-c0b9-48e9-aed2-21c55509308cn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25032&group=comp.os.vms#25032

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:620a:16c8:b0:6ce:21bd:7e41 with SMTP id a8-20020a05620a16c800b006ce21bd7e41mr10814664qkn.304.1664094701529;
Sun, 25 Sep 2022 01:31:41 -0700 (PDT)
X-Received: by 2002:a05:620a:1905:b0:6ce:fe9a:f79f with SMTP id
bj5-20020a05620a190500b006cefe9af79fmr10521619qkb.204.1664094701357; Sun, 25
Sep 2022 01:31:41 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.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.os.vms
Date: Sun, 25 Sep 2022 01:31:40 -0700 (PDT)
In-Reply-To: <8f5106ac-dd4b-4e8f-be24-0a3400650a49n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c0:8f1b:ac01:a05d:68b6:8089:4b3e;
posting-account=cHmS7AoAAACMYAFH9kP9m4l8qjrXLvte
NNTP-Posting-Host: 2003:c0:8f1b:ac01:a05d:68b6:8089:4b3e
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <8f5106ac-dd4b-4e8f-be24-0a3400650a49n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cfb93483-c0b9-48e9-aed2-21c55509308cn@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: volker_h...@hotmail.com (Volker Halle)
Injection-Date: Sun, 25 Sep 2022 08:31:41 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1498
 by: Volker Halle - Sun, 25 Sep 2022 08:31 UTC

The DFU documentation discusses directory compression in

5.3.2 Discussion of directory compression

$ SET FILE/TRUNCATE on a .DIR file also works, but only truncates the blocks after EFBLK.

DFU can also compress sparsely filled directory blocks.

Volker.

Re: Empty blocks in FILES-11 directory files.

<6iYXK.345155$vSy3.272445@fx04.ams4>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25033&group=comp.os.vms#25033

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx04.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.3.0
Subject: Re: Empty blocks in FILES-11 directory files.
Newsgroups: comp.os.vms
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
Content-Language: en-US
From: mark.dan...@wasd.vsm.com.au (Mark Daniel)
In-Reply-To: <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 121
Message-ID: <6iYXK.345155$vSy3.272445@fx04.ams4>
X-Complaints-To: abuse@eweka.nl
NNTP-Posting-Date: Sun, 25 Sep 2022 13:00:50 UTC
Organization: Eweka Internet Services
Date: Sun, 25 Sep 2022 22:30:49 +0930
X-Received-Bytes: 5670
 by: Mark Daniel - Sun, 25 Sep 2022 13:00 UTC

On 25/9/2022 5:01 pm, Volker Halle wrote:
> Mark,

Thanks for the detailed response Volker.

> does your utility read until the 'End of file block' or the 'Highest block' of the directory file ?

It uses a "generic" file read function as "raw" blocks into memory. It
reads the exact number of bytes indicated by the file header.

if (odsptr->XabFhc.xab$l_ebk <= 1)
SizeInBytes = odsptr->XabFhc.xab$w_ffb;
else
SizeInBytes = ((odsptr->XabFhc.xab$l_ebk-1) << 9) +
odsptr->XabFhc.xab$w_ffb;
/* round-up ensure we have a full complement of blocks allocated */
odsptr->DataPtr = (char*)VmGet (((SizeInBytes/512)+1)*512);
odsptr->DataLength = 0;

odsptr->Rab.rab$l_ubf = odsptr->DataPtr;
for (;;)
{
if (SizeInBytes > 512*127)
odsptr->Rab.rab$w_usz = 512*127;
else
if (SizeInBytes > 0)
odsptr->Rab.rab$w_usz = SizeInBytes;
else
break;

status = sys$read (&odsptr->Rab, 0, 0);
if (VMSnok (status)) break;

odsptr->DataLength += odsptr->Rab.rab$w_rsz;
odsptr->Rab.rab$l_ubf += odsptr->Rab.rab$w_rsz;
SizeInBytes -= odsptr->Rab.rab$w_rsz;
}

sys$close (&odsptr->Fab, 0, 0);

So I guess to the highest block.

> Free blocks should only be at the end of the directory file - after the EFBLK.
>
> The logical end of the directory would be the last 'directory record' in the 'End of file block' of the directory file, i.e. a directory record with DIR$W_SIZE=-1 marks the end of directory records in the current block and therefore the end of the directory in the 'End of file block'

Then it looks like the code reads the size of the file bytes and so
scans past the DIR$W_SIZE=-1 in the end of file block and on to the end
of the file itself.

Having been emptied by file name deletions mid-file and then
(effectively) "shuffled" to the end of the file these should all contain
DIR$W_SIZE=-1 and therefore qualify as empty blocks, as per your later
post that included ...

> When compressing a directory file, EFBLK will be updated, but the blocks between EFBLK+1 and the highest block allocated will not be overwritten with zeroes, even if 'file high-water marking' is set.

> $ DUMP/DIR directory_file.DIR should show the last record as: 'xxx End of records (-1)' in the EOF block.
>
> The function to 'shuffle' a directory (extend or compress) is called SHUFFLE_DIR, found in module [F11X]SHFDIR

:-) Seems all engineering types go for unimaginative (but
understandable) nomenclature.

It also indicates that any accessible directory file should not contain
embedded empty blocks as they should all have been shuffled to the end.

> Directory files are and must be contiguous. DUMP/HEADER directory.DIR shows:

Still a design consideration then.

> File characteristics: Contiguous, Directory
>
> This allows more efficient reads/writes and prevents window turns, when already executing inside the XQP.
>
> Volker.

> Mark, what is your definition of 'empty blocks' - all zeroes ?

No, not zeroes.

/* if not end of records (in this block) sentinal */
if (rlen && rlen != (uint)0xffff && rlen < 508)
{
/* records are always on even byte (word) boundaries */
rzptr = rptr + rlen;
if ((int)rzptr & 1) rzptr++;

/* break from loop to process record */
EmptyBlockCount = 0;
break;
}
else
if (rlen && rlen != (uint)0xffff && rlen > 508)
{
status = SS$_BUGCHECK;
8< snip 8<
/* sanity check report */
break;
}
else
if (EmptyBlockCount++ > 16)
{
/* empty blocks should only occur at end of directory */
break;
}

The |if (EmptyBlockCount++ > 16)| is recently revised code based on the
strong feeling from c.o.v. posts all "empty blocks" from the "shuffle"
should be at the trailing end of the directory file. This used to be a
sanity check because I was originally unsure of the role of these.

I should add that this code has been in use for some years and apart
from a handful of (corrected) bugs has been (appearing to) perform well.

--
Anyone, who using social-media, forms an opinion regarding anything
other than the relative cuteness of this or that puppy-dog, needs
seriously to examine their critical thinking.

Re: Empty blocks in FILES-11 directory files.

<2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25035&group=comp.os.vms#25035

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:622a:15d4:b0:35c:dda3:7bc5 with SMTP id d20-20020a05622a15d400b0035cdda37bc5mr14699537qty.676.1664116038588;
Sun, 25 Sep 2022 07:27:18 -0700 (PDT)
X-Received: by 2002:ac8:5f89:0:b0:35c:eaf1:fa2c with SMTP id
j9-20020ac85f89000000b0035ceaf1fa2cmr14864128qta.89.1664116038417; Sun, 25
Sep 2022 07:27:18 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.mixmin.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.os.vms
Date: Sun, 25 Sep 2022 07:27:18 -0700 (PDT)
In-Reply-To: <6iYXK.345155$vSy3.272445@fx04.ams4>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c0:8f1b:ac60:90:76a1:d8ad:1423;
posting-account=cHmS7AoAAACMYAFH9kP9m4l8qjrXLvte
NNTP-Posting-Host: 2003:c0:8f1b:ac60:90:76a1:d8ad:1423
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: volker_h...@hotmail.com (Volker Halle)
Injection-Date: Sun, 25 Sep 2022 14:27:18 +0000
Content-Type: text/plain; charset="UTF-8"
 by: Volker Halle - Sun, 25 Sep 2022 14:27 UTC

Mark,

if your program reports an error again, you should then carefully examine the directory file in question with

$ DUMP/DIR/HEADER directory-filename.DIR/OUT=temp_file

> So I guess to the highest block.

No, the code reads until XabFhc.xab$l_ebk, which is the EFBLK (end-of-file block). And therefore should not find 'empty blocks'.

Test for yourself: create a directory, populate it with a couple of files until EFBLK becomes > 1, then delete all files in that directory.
Use DUMP/HEADER to find the start LBN of the directory file and then DUMP/BLOCKS=(START=start_lbn,SIZE=2) disk:
You'll see, that the blocks beyond VBN 1 of the directory file contain 'old directory data', not zeros and they don't start with DIR$W_SIZE=FFFF

> > File characteristics: Contiguous, Directory
> >
> > This allows more efficient reads/writes and prevents window turns, when already executing inside the XQP.
> Still a design consideration then.

Please read the second half of that sentence: I strongly believe you can't do a window turn (which involves the XQP), if you are already in the XQP executing a directory operation. So directory files must be contiguous.

Once you hit this problem again, feel free to provide some more details.

Volker.

Re: Empty blocks in FILES-11 directory files.

<68b6fcca-6221-4b96-a15d-ac0a0a654756n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25036&group=comp.os.vms#25036

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:590f:0:b0:35c:c247:9731 with SMTP id 15-20020ac8590f000000b0035cc2479731mr15089945qty.114.1664128794502;
Sun, 25 Sep 2022 10:59:54 -0700 (PDT)
X-Received: by 2002:a05:6214:20aa:b0:4ac:a951:11d6 with SMTP id
10-20020a05621420aa00b004aca95111d6mr14558471qvd.88.1664128794264; Sun, 25
Sep 2022 10:59:54 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border-2.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Sun, 25 Sep 2022 10:59:53 -0700 (PDT)
In-Reply-To: <2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=104.231.150.181; posting-account=CO-_tAoAAACjjs2KLAw3xVKCy6Z_J3VK
NNTP-Posting-Host: 104.231.150.181
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4> <2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <68b6fcca-6221-4b96-a15d-ac0a0a654756n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: osuvma...@gmail.com (David Jones)
Injection-Date: Sun, 25 Sep 2022 17:59:54 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 6
 by: David Jones - Sun, 25 Sep 2022 17:59 UTC

On Sunday, September 25, 2022 at 10:27:19 AM UTC-4, Volker Halle wrote:
> Please read the second half of that sentence: I strongly believe you can't do a window turn (which involves the XQP), if you are already in the XQP executing a directory operation. So directory files must be contiguous.
>

There is a middle ground, such as what happens with the pager. The page file doesn't have to be contiguous,
but the file can't have extension headers (i.e. all retrieval pointers must fit in the primary header). If the header
for the directory file is cached in memory, a window turn won't require I/O.

Re: Empty blocks in FILES-11 directory files.

<a9b1b301-bdc4-481f-8f4e-229e6c872a8fn@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25037&group=comp.os.vms#25037

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:29e8:b0:4ad:8cb6:9d39 with SMTP id jv8-20020a05621429e800b004ad8cb69d39mr12974693qvb.20.1664141698401;
Sun, 25 Sep 2022 14:34:58 -0700 (PDT)
X-Received: by 2002:a05:622a:4e:b0:35d:159:3d95 with SMTP id
y14-20020a05622a004e00b0035d01593d95mr15940632qtw.362.1664141698242; Sun, 25
Sep 2022 14:34:58 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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.os.vms
Date: Sun, 25 Sep 2022 14:34:58 -0700 (PDT)
In-Reply-To: <68b6fcca-6221-4b96-a15d-ac0a0a654756n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=100.2.123.53; posting-account=r2_qcwoAAACbIdit5Eka3ivGvrYZz7UQ
NNTP-Posting-Host: 100.2.123.53
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4> <2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
<68b6fcca-6221-4b96-a15d-ac0a0a654756n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a9b1b301-bdc4-481f-8f4e-229e6c872a8fn@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: gezel...@rlgsc.com (Bob Gezelter)
Injection-Date: Sun, 25 Sep 2022 21:34:58 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2573
 by: Bob Gezelter - Sun, 25 Sep 2022 21:34 UTC

On Sunday, September 25, 2022 at 1:59:55 PM UTC-4, osuv...@gmail.com wrote:
> On Sunday, September 25, 2022 at 10:27:19 AM UTC-4, Volker Halle wrote:
> > Please read the second half of that sentence: I strongly believe you can't do a window turn (which involves the XQP), if you are already in the XQP executing a directory operation. So directory files must be contiguous.
> >
> There is a middle ground, such as what happens with the pager. The page file doesn't have to be contiguous,
> but the file can't have extension headers (i.e. all retrieval pointers must fit in the primary header). If the header
> for the directory file is cached in memory, a window turn won't require I/O.
Mark,

Am in a bit of a hurry, so I will not go into details.

However, COPY is definitely not needed. RENAME is quite enough, preferably in the advantageous order to not create repeated shuffles.

I would have to go digging, but it is also advantageous to create a directory of the desired size, and not just use the default. That way, there is no need to grow the directory and incur the resulting copies.

- Bob Gezelter, http://www.rlgsc.com

Re: Empty blocks in FILES-11 directory files.

<6_4YK.163589$5p2.128094@fx15.ams4>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25038&group=comp.os.vms#25038

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx15.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.3.0
Subject: Re: Empty blocks in FILES-11 directory files.
Content-Language: en-US
Newsgroups: comp.os.vms
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
From: mark.dan...@wasd.vsm.com.au (Mark Daniel)
In-Reply-To: <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 83
Message-ID: <6_4YK.163589$5p2.128094@fx15.ams4>
X-Complaints-To: abuse@eweka.nl
NNTP-Posting-Date: Sun, 25 Sep 2022 22:53:54 UTC
Organization: Eweka Internet Services
Date: Mon, 26 Sep 2022 08:23:54 +0930
X-Received-Bytes: 4440
 by: Mark Daniel - Sun, 25 Sep 2022 22:53 UTC

On 25/9/2022 5:01 pm, Volker Halle wrote:
> Mark,
>
> does your utility read until the 'End of file block' or the 'Highest block' of the directory file ?

I responded as 'highest block' but as you pointed out it only read to
the final byte in the file, not to the end-of-block or allocation.

> Free blocks should only be at the end of the directory file - after the EFBLK.
>
> The logical end of the directory would be the last 'directory record' in the 'End of file block'of the directory file, i.e. a directory record with DIR$W_SIZE=-1 marks the end of directory records in the current block and therefore the end of the directory in the 'End of file block'

This is the bit I missed!!

The "DIR$W_SIZE=-1 marks the end of directory records in the
current block and therefore the end of the directory in the
'End of file block'

After reading the end of record (-1) the code did not check whether this
was the EFBLK. It "continue"d (literally) on its merry way trying to
read more records.

/* continue to parse if not at end of content */
if (rptr < dzptr) continue;

/* end of records (file names) */
odsptr->DirectTheLength =
odsptr->DirectTheRecord =
odsptr->DirectSubRecord = 0;
if (odsptr->DirectWildcard[0])
status = RMS$_NMF;
else
status = RMS$_FNF;
break;

The code now explicitly tests for EBLK (in its own inimitable fashion).

if (rlen == (uint)0xffff && dzptr - rptr <= 512)
{
/* end of records in end file block */
odsptr->DirectTheLength =
odsptr->DirectTheRecord =
odsptr->DirectSubRecord = 0;
if (odsptr->DirectWildcard[0])
status = RMS$_NMF;
else
status = RMS$_FNF;
break;
}

The |EmtypBlockCount| was always a misnomer, perhaps better as
|EmptyRecordCount| because that is what it was ticking over. But still
a kludge and a result of missing the EFBLK factor. The kludge worked
until it didn't.

The generic file read originally referred to, does allocate what it
considers a whole number of blocks (of zeroed memory), from an earlier post

> /* round-up ensure we have a full complement of blocks allocated */
> odsptr->DataPtr = (char*)VmGet (((SizeInBytes/512)+1)*512);

which would (perhaps) explain the variable number of "empty records"
(less misleading name for the variable) following the end-of-records
sentinel in the end-of-file block.

> $ DUMP/DIR directory_file.DIR should show the last record as: 'xxx End of records (-1)' in the EOF block.
>
> The function to 'shuffle' a directory (extend or compress) is called SHUFFLE_DIR, found in module [F11X]SHFDIR
>
> Directory files are and must be contiguous. DUMP/HEADER directory.DIR shows:
>
> File characteristics: Contiguous, Directory
>
> This allows more efficient reads/writes and prevents window turns, when already executing inside the XQP.
>
> Volker.

--
Anyone, who using social-media, forms an opinion regarding anything
other than the relative cuteness of this or that puppy-dog, needs
seriously to examine their critical thinking.

Re: Empty blocks in FILES-11 directory files.

<q_4YK.163590$5p2.128927@fx15.ams4>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25039&group=comp.os.vms#25039

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!fx15.ams4.POSTED!not-for-mail
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.3.0
Subject: Re: Empty blocks in FILES-11 directory files.
Content-Language: en-US
Newsgroups: comp.os.vms
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4>
<2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
From: mark.dan...@wasd.vsm.com.au (Mark Daniel)
In-Reply-To: <2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 50
Message-ID: <q_4YK.163590$5p2.128927@fx15.ams4>
X-Complaints-To: abuse@eweka.nl
NNTP-Posting-Date: Sun, 25 Sep 2022 22:54:14 UTC
Organization: Eweka Internet Services
Date: Mon, 26 Sep 2022 08:24:13 +0930
X-Received-Bytes: 3321
 by: Mark Daniel - Sun, 25 Sep 2022 22:54 UTC

On 25/9/2022 11:57 pm, Volker Halle wrote:
> Mark,
>
> if your program reports an error again, you should then carefully examine the directory file in question with
>
> $ DUMP/DIR/HEADER directory-filename.DIR/OUT=temp_file
>
>> So I guess to the highest block.
>
> No, the code reads until XabFhc.xab$l_ebk, which is the EFBLK (end-of-file block). And therefore should not find 'empty blocks'.

As noted in my previous post, yes, indeed. I missed the end-of-record
in the end-of-file-block essential element and went on parsing "empty
records" (I believe) in the zeroed memory.

> Test for yourself: create a directory, populate it with a couple of files until EFBLK becomes > 1, then delete all files in that directory.

I have performed multiple iterations of this scenario and am currently
using it as a test setup. Can't explain why initially I felt so
flummoxed in setting up a test scenario. Thanks for all the DUMP tools.
Don't believe I've used DUMP for file system work in at least 25 years.

> Use DUMP/HEADER to find the start LBN of the directory file and then DUMP/BLOCKS=(START=start_lbn,SIZE=2) disk:
> You'll see, that the blocks beyond VBN 1 of the directory file contain 'old directory data', not zeros and they don't start with DIR$W_SIZE=FFFF

$ DUMP/BLOCKS=(START=n,COUNT=n) DKA100:

confirms your statement.

>>> File characteristics: Contiguous, Directory
>>>
>>> This allows more efficient reads/writes and prevents window turns, when already executing inside the XQP.
>> Still a design consideration then.

I merely meant that directory files (still) must be contiguous.

> Please read the second half of that sentence: I strongly believe you can't do a window turn (which involves the XQP), if you are already in the XQP executing a directory operation. So directory files must be contiguous.
>
> Once you hit this problem again, feel free to provide some more details.
>
> Volker.

Thanks to all who contributed to this thread.

--
Anyone, who using social-media, forms an opinion regarding anything
other than the relative cuteness of this or that puppy-dog, needs
seriously to examine their critical thinking.

Re: Empty blocks in FILES-11 directory files.

<tgrom0$d90$1@news.misty.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25042&group=comp.os.vms#25042

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!.POSTED.185.159.157.200!not-for-mail
From: bqt...@softjar.se (Johnny Billquist)
Newsgroups: comp.os.vms
Subject: Re: Empty blocks in FILES-11 directory files.
Date: Mon, 26 Sep 2022 10:42:39 +0200
Organization: MGT Consulting
Message-ID: <tgrom0$d90$1@news.misty.com>
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 26 Sep 2022 08:42:40 -0000 (UTC)
Injection-Info: news.misty.com; posting-host="185.159.157.200";
logging-data="13600"; mail-complaints-to="abuse@misty.com"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0)
Gecko/20100101 Thunderbird/91.13.0
Content-Language: en-US
In-Reply-To: <6iYXK.345155$vSy3.272445@fx04.ams4>
 by: Johnny Billquist - Mon, 26 Sep 2022 08:42 UTC

On 2022-09-25 15:00, Mark Daniel wrote:
> On 25/9/2022 5:01 pm, Volker Halle wrote:
>> Mark,
>
> Thanks for the detailed response Volker.
>
>> does your utility read until the 'End of file block' or the 'Highest
>> block' of the directory file ?
>
> It uses a "generic" file read function as "raw" blocks into memory.  It
> reads the exact number of bytes indicated by the file header.
>
>    if (odsptr->XabFhc.xab$l_ebk <= 1)
>       SizeInBytes = odsptr->XabFhc.xab$w_ffb;
>    else
>       SizeInBytes = ((odsptr->XabFhc.xab$l_ebk-1) << 9) +
>                     odsptr->XabFhc.xab$w_ffb;

Are directory files in ODS-2 using fixed size records? Because otherwise
you have a problem here that you cannot compute how many bytes you have
in a file like this.

The ffb tells where the first free byte is, so that appends to a file
can be done. However, the number of bytes you actually have in a file
does not include the record lengths of variable sized records, nor the
padding for odd length records. But these things only happen on variable
record length files, which is why I ask.
In ODS-1, the records are fixed length, but then again, ODS-1 filenames
are very much more limited, and the directory format is much simpler.

Johnny

Re: Empty blocks in FILES-11 directory files.

<8c2247c0-8cfb-48f1-9f4a-bdc87ec83bf9n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25043&group=comp.os.vms#25043

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:ac8:7dd3:0:b0:35c:c054:de8e with SMTP id c19-20020ac87dd3000000b0035cc054de8emr16727203qte.194.1664184383968;
Mon, 26 Sep 2022 02:26:23 -0700 (PDT)
X-Received: by 2002:ae9:f815:0:b0:6ce:a0e7:7779 with SMTP id
x21-20020ae9f815000000b006cea0e77779mr13513708qkh.781.1664184383780; Mon, 26
Sep 2022 02:26:23 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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.os.vms
Date: Mon, 26 Sep 2022 02:26:23 -0700 (PDT)
In-Reply-To: <tgrom0$d90$1@news.misty.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c0:8f1b:ac60:51b5:abc7:1811:1c7b;
posting-account=cHmS7AoAAACMYAFH9kP9m4l8qjrXLvte
NNTP-Posting-Host: 2003:c0:8f1b:ac60:51b5:abc7:1811:1c7b
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4> <tgrom0$d90$1@news.misty.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8c2247c0-8cfb-48f1-9f4a-bdc87ec83bf9n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: volker_h...@hotmail.com (Volker Halle)
Injection-Date: Mon, 26 Sep 2022 09:26:23 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 1611
 by: Volker Halle - Mon, 26 Sep 2022 09:26 UTC

Johnny,

you'll find all you want to know about OpenVMS directory structures in

http://www.bitsavers.org/pdf/dec/vax/vms/training/EY-F575E-DP_VMS_File_System_Internals_1990.pdf

page 53 onwards: 2.4 Basic Concept of a Directory

Volker.

Re: Empty blocks in FILES-11 directory files.

<bc78d615-e04c-4aa7-adfa-550c1c636972n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25044&group=comp.os.vms#25044

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:268a:b0:4a3:a054:cb16 with SMTP id gm10-20020a056214268a00b004a3a054cb16mr16904735qvb.43.1664184786739;
Mon, 26 Sep 2022 02:33:06 -0700 (PDT)
X-Received: by 2002:a05:6214:234f:b0:4ad:6637:6f23 with SMTP id
hu15-20020a056214234f00b004ad66376f23mr16076271qvb.16.1664184786589; Mon, 26
Sep 2022 02:33:06 -0700 (PDT)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.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.os.vms
Date: Mon, 26 Sep 2022 02:33:06 -0700 (PDT)
In-Reply-To: <68b6fcca-6221-4b96-a15d-ac0a0a654756n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2003:c0:8f1b:ac60:51b5:abc7:1811:1c7b;
posting-account=cHmS7AoAAACMYAFH9kP9m4l8qjrXLvte
NNTP-Posting-Host: 2003:c0:8f1b:ac60:51b5:abc7:1811:1c7b
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4> <2d839219-6e1f-491e-b93a-1a608a47621an@googlegroups.com>
<68b6fcca-6221-4b96-a15d-ac0a0a654756n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bc78d615-e04c-4aa7-adfa-550c1c636972n@googlegroups.com>
Subject: Re: Empty blocks in FILES-11 directory files.
From: volker_h...@hotmail.com (Volker Halle)
Injection-Date: Mon, 26 Sep 2022 09:33:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 2632
 by: Volker Halle - Mon, 26 Sep 2022 09:33 UTC

osuv...@gmail.com schrieb am Sonntag, 25. September 2022 um 19:59:55 UTC+2:
> On Sunday, September 25, 2022 at 10:27:19 AM UTC-4, Volker Halle wrote:
> > Please read the second half of that sentence: I strongly believe you can't do a window turn (which involves the XQP), if you are already in the XQP executing a directory operation. So directory files must be contiguous.
> >
> There is a middle ground, such as what happens with the pager. The page file doesn't have to be contiguous,
> but the file can't have extension headers (i.e. all retrieval pointers must fit in the primary header). If the header
> for the directory file is cached in memory, a window turn won't require I/O.

Even if a directory would only be allowed to have a primary file header, you would still have to do a window turn, if there are more than ACP_WINDOW (default: 7) retrieval pointers. When handling directory expansion/compression the XQP is already operating in XQP 'secondary context' and I bet, that the XQP cannot invoke a window turn in that context.

Volker.

Re: Empty blocks in FILES-11 directory files.

<tgtaca$1in1$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25049&group=comp.os.vms#25049

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Empty blocks in FILES-11 directory files.
Date: Mon, 26 Sep 2022 18:50:50 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tgtaca$1in1$1@gioia.aioe.org>
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4> <tgrom0$d90$1@news.misty.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="51937"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
 by: Arne Vajhøj - Mon, 26 Sep 2022 22:50 UTC

On 9/26/2022 4:42 AM, Johnny Billquist wrote:
> On 2022-09-25 15:00, Mark Daniel wrote:
>> On 25/9/2022 5:01 pm, Volker Halle wrote:
>>> does your utility read until the 'End of file block' or the 'Highest
>>> block' of the directory file ?
>>
>> It uses a "generic" file read function as "raw" blocks into memory.
>> It reads the exact number of bytes indicated by the file header.
>>
>>     if (odsptr->XabFhc.xab$l_ebk <= 1)
>>        SizeInBytes = odsptr->XabFhc.xab$w_ffb;
>>     else
>>        SizeInBytes = ((odsptr->XabFhc.xab$l_ebk-1) << 9) +
>>                      odsptr->XabFhc.xab$w_ffb;
>
> Are directory files in ODS-2 using fixed size records? Because otherwise
> you have a problem here that you cannot compute how many bytes you have
> in a file like this.
>
> The ffb tells where the first free byte is, so that appends to a file
> can be done. However, the number of bytes you actually have in a file
> does not include the record lengths of variable sized records, nor the
> padding for odd length records. But these things only happen on variable
> record length files, which is why I ask.

Fixed length files are also padded to even number bytes.

But the "standard" FIX 512 is even.

Arne

Style question, was: Re: Empty blocks in FILES-11 directory files.

<tgvdfg$446p$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25055&group=comp.os.vms#25055

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: club...@remove_me.eisner.decus.org-Earth.UFP (Simon Clubley)
Newsgroups: comp.os.vms
Subject: Style question, was: Re: Empty blocks in FILES-11 directory files.
Date: Tue, 27 Sep 2022 17:56:00 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 62
Message-ID: <tgvdfg$446p$1@dont-email.me>
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4> <64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com> <6iYXK.345155$vSy3.272445@fx04.ams4>
Injection-Date: Tue, 27 Sep 2022 17:56:00 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="fc68fe4cac7695878c78a790e4169b17";
logging-data="135385"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+1XltuKe6tiOxn/rVsQDDI/2I8WG7yKTA="
User-Agent: slrn/0.9.8.1 (VMS/Multinet)
Cancel-Lock: sha1:cwCcwBqvCDs8xFseQK8ZCk4Mys0=
 by: Simon Clubley - Tue, 27 Sep 2022 17:56 UTC

On 2022-09-25, Mark Daniel <mark.daniel@wasd.vsm.com.au> wrote:
>
> odsptr->Rab.rab$l_ubf = odsptr->DataPtr;
> for (;;)
> {
> if (SizeInBytes > 512*127)
> odsptr->Rab.rab$w_usz = 512*127;
> else
> if (SizeInBytes > 0)
> odsptr->Rab.rab$w_usz = SizeInBytes;
> else
> break;
>

I have a style question about this part of Mark's code and was wondering
if this was a common style, or if you always made liberal use of braces
to help draw attention to the nesting going on here and to help avoid
some later editing mistakes.

For example, I would write this code section as something like this:

if (SizeInBytes > 512*127)
{
odsptr->Rab.rab$w_usz = 512*127;
}
else
{
if (SizeInBytes > 0)
{
odsptr->Rab.rab$w_usz = SizeInBytes;
}
else
{
break;
}
}

(and yes, wrapping single statements in braces is also deliberate here.)

For me, I find the liberal use of braces helps to draw attention to the
code structure, is more readable in general (at least to me), and helps
avoid some mistakes during later editing.

Just wondering which is the more common style in the C code you have seen.

> status = sys$read (&odsptr->Rab, 0, 0);
> if (VMSnok (status)) break;
>
> odsptr->DataLength += odsptr->Rab.rab$w_rsz;
> odsptr->Rab.rab$l_ubf += odsptr->Rab.rab$w_rsz;
> SizeInBytes -= odsptr->Rab.rab$w_rsz;
> }
>
> sys$close (&odsptr->Fab, 0, 0);

Simon.

PS: Yes, Simon's a Whitesmiths fan. Other indentation styles are available. :-)

--
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.

Re: Style question, was: Re: Empty blocks in FILES-11 directory files.

<pu-dnf-TQO2D2q7-nZ2dnZfqnPpg4p2d@giganews.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25056&group=comp.os.vms#25056

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.iad1.usenetexpress.com!69.80.99.23.MISMATCH!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 27 Sep 2022 18:55:26 +0000
Sender: Dennis Boone <drb@yagi.h-net.org>
From: drb...@ihatespam.msu.edu (Dennis Boone)
Subject: Re: Style question, was: Re: Empty blocks in FILES-11 directory files.
Newsgroups: comp.os.vms
References: <Q9HXK.514313$14z3.96406@fx11.ams4> <qGMXK.504537$nwq3.138903@fx13.ams4> <64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com> <29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com> <6iYXK.345155$vSy3.272445@fx04.ams4> <tgvdfg$446p$1@dont-email.me>
User-Agent: tin/2.6.1-20211226 ("Convalmore") (FreeBSD/13.1-RELEASE-p2 (amd64))
Message-ID: <pu-dnf-TQO2D2q7-nZ2dnZfqnPpg4p2d@giganews.com>
Date: Tue, 27 Sep 2022 18:55:26 +0000
Lines: 13
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-O55LgDvKQcBbW+VNGizdidsEtfFGmIP3a4BZxWPtKaacIwqi4PgO6YIFZlplIAPdK9k4ehtMSa4c4J9!B+wzFk7v63uSdVmqhKGAyoKJebriH/DBUJyA1q+5Xcx764vJxrPuaTqWwzz7Tvgj/J6chqo=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
X-Received-Bytes: 1928
 by: Dennis Boone - Tue, 27 Sep 2022 18:55 UTC

> For me, I find the liberal use of braces helps to draw attention to the
> code structure, is more readable in general (at least to me), and helps
> avoid some mistakes during later editing.

Wrapping even single statement loop/conditional/... blocks in braces
avoids misconstruing an indented statement as inside the block because
it shares indent level. It's recommended by some style / code quality
guides.

There are lots of styles, and about lots^2 internet wars over which is
best. Best not to start the ^3 round. :)

De

Re: Style question, was: Re: Empty blocks in FILES-11 directory files.

<tgvibh$hvd$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=25057&group=comp.os.vms#25057

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!aioe.org!LeVffQP25j5GAigzc2gaQA.user.46.165.242.75.POSTED!not-for-mail
From: arn...@vajhoej.dk (Arne Vajhøj)
Newsgroups: comp.os.vms
Subject: Re: Style question, was: Re: Empty blocks in FILES-11 directory
files.
Date: Tue, 27 Sep 2022 15:19:13 -0400
Organization: Aioe.org NNTP Server
Message-ID: <tgvibh$hvd$1@gioia.aioe.org>
References: <Q9HXK.514313$14z3.96406@fx11.ams4>
<qGMXK.504537$nwq3.138903@fx13.ams4>
<64d3d15b-10c0-4e23-96a4-87afdc75cb08n@googlegroups.com>
<29a84d4d-f9e8-4a7c-9c80-649f79318a82n@googlegroups.com>
<6iYXK.345155$vSy3.272445@fx04.ams4> <tgvdfg$446p$1@dont-email.me>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="18413"; posting-host="LeVffQP25j5GAigzc2gaQA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.3.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Arne Vajhøj - Tue, 27 Sep 2022 19:19 UTC

On 9/27/2022 1:56 PM, Simon Clubley wrote:
> On 2022-09-25, Mark Daniel <mark.daniel@wasd.vsm.com.au> wrote:
>>
>> odsptr->Rab.rab$l_ubf = odsptr->DataPtr;
>> for (;;)
>> {
>> if (SizeInBytes > 512*127)
>> odsptr->Rab.rab$w_usz = 512*127;
>> else
>> if (SizeInBytes > 0)
>> odsptr->Rab.rab$w_usz = SizeInBytes;
>> else
>> break;
>>
>
> I have a style question about this part of Mark's code and was wondering
> if this was a common style, or if you always made liberal use of braces
> to help draw attention to the nesting going on here and to help avoid
> some later editing mistakes.
>
> For example, I would write this code section as something like this:
>
> if (SizeInBytes > 512*127)
> {
> odsptr->Rab.rab$w_usz = 512*127;
> }
> else
> {
> if (SizeInBytes > 0)
> {
> odsptr->Rab.rab$w_usz = SizeInBytes;
> }
> else
> {
> break;
> }
> }
>
> (and yes, wrapping single statements in braces is also deliberate here.)
>
> For me, I find the liberal use of braces helps to draw attention to the
> code structure, is more readable in general (at least to me), and helps
> avoid some mistakes during later editing.
>
> Just wondering which is the more common style in the C code you have seen.

For both whether to use block construct for single statement and
for indentation style the right answer is whatever style is agreed on
in the project.

:-)

If I were in the project meeting discussing these topics then I would
argue for using block construct for single statements.

But honestly then I sometimes I forget myself.

Arne

PS: For braces I would vote Allman for C/C++, but different for other
languages.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor