Re: file list order OS_GBPB

17 views
Skip to first unread message

Gerald Holdsworth

unread,
Dec 31, 2020, 8:00:59 AM12/31/20
to
On 31/12/2020 12:39, Bob Latham wrote:
> I'm writing a routine to scan the text files in a directory and make
> some small changes. What I would like to know is, what file
> operations will change the order the files are presented as in R4
> such that I need to scan again from R4=0 to avoid missing a file.
>
> I am changing the file name, by adding /txt, changing the line
> endings from LF to CR-LF and finally restoring the time stamp.
>
> Or will none of that change the order?
>
> Thanks.
>
> Bob.
>

ADFS tends to store the files in alphanumerical order (or should that be
ASCII order?). DFS stores them in the order the data is on the disc (and
sorts them into alpha order when you *CAT).

Cheers,

Gerald.

--
gerald at hollypops dot co dot uk
Repton Resource Page
www.reptonresourcepage.co.uk

John Williams (News)

unread,
Dec 31, 2020, 8:02:40 AM12/31/20
to
In article <58e77a...@sick-of-spam.invalid>,
Bob Latham <b...@sick-of-spam.invalid> wrote:

> I'm writing a routine to scan the text files in a directory and make
> some small changes. What I would like to know is, what file
> operations will change the order the files are presented as in R4
> such that I need to scan again from R4=0 to avoid missing a file.

For this sort of thing I normally use EnumDir to give me a list of
filenames to operate with. It has the advantage of creating a list the
order of which is then irrelevant! Also its pattern-matching option can be
helpful.

> I am changing the file name, by adding /txt, changing the line
> endings from LF to CR-LF and finally restoring the time stamp.

> Or will none of that change the order?

I don't see why it should.

But having a list to work with avoids such a possibility. This could also
be used to create a Wipe list so that you are effectively modifying to a
copy (as you're adding an extension), saving the final wipe until all has
been well-proven to be the result you expected - another handy
possibility/advantage of the list method!

You only need to action the "Wipe" in the finished version after extensive
testing!

Best wishes,

John

Martin

unread,
Dec 31, 2020, 8:41:52 AM12/31/20
to
In article <58e77a...@sick-of-spam.invalid>,
Bob Latham <b...@sick-of-spam.invalid> wrote:
> Or will none of that change the order?

Basically there is NO defined order which OS_GBPB returns files.

Best never to rely on it if you want it work always on all FS.

--
Martin Avison
Note that unfortunately this email address will become invalid
without notice if (when) any spam is received.

druck

unread,
Dec 31, 2020, 8:42:47 AM12/31/20
to
On 31/12/2020 12:39, Bob Latham wrote:
> I'm writing a routine to scan the text files in a directory and make
> some small changes. What I would like to know is, what file
> operations will change the order the files are presented as in R4
> such that I need to scan again from R4=0 to avoid missing a file.
>
> I am changing the file name, by adding /txt, changing the line
> endings from LF to CR-LF and finally restoring the time stamp.

I wouldn't do any operations on a directory while scanning it. Get a
list of all the files you are interested in from the scan, then fiddle
with the files afterwards.

> Or will none of that change the order?

Anything altering just the file's data such as CR/LF changes wont affect
anything in the directory, but renaming files might, depending on the
underlying filing system. Filecore plays nice, others may not.

---druck

Reply all
Reply to author
Forward
0 new messages