Strange behavior High Sierra Intel / M1 Big Sur

In my analyzing software, I have troubles related to the use of a M1 MBP… I added some txt files created there, add text to image file names.

The hard disk is an external HDD disk that navigates from that computer and an old i5 Intel.

I noticed some strange results (for example a line [generated from a file name] does not appears in the result.
After writting a long text question here, I decided to mad-ke a simple report into a new TextArea:

TextArea1.AppendText Item_FI.Name + EndOfLine

and check the result.

One line from one folder (the one I knew have a problem from a previous analyze) does not appears. That line exist as a file in the target folder.

Worst: I copied the file prefix from a line that is reported (say “National Geographics 485 ”) and pasted to the not reported file replacing what was there previously and re-run the analyze: the forgotten entry now is here.

I looked at the file name in the debugger (Item_FI.Name Property, displayed as Binary), but noticed nothing special.

BTW: I use Item_FI.Name and report parts of it. Nothing strange or special.

Worst: some entries do not appears where it is due.

On El Capitan, the files are returned alphabetized; the analyze returns page 99 first (sometimes), sometime it returns it where due (at the end). And these files (.txt files, other entries are .jpg files) were added with the 1 using TextEdit there to generate the first one (0 byte files), typing there the file names. (I used 99 as the page number, for this file, because this must be the last one; no book have more than 68 pages…)

The source folder, displayed as list (by file name) display correctly the files.

This does not happens on all files, only some. I cannot complete the files names for some M1 created files yesterday, and I added these information earlier today. Some appears correctly, some not.

This looks like some random event appear…

I create the report data in a TextArea using TextArea_Rpt.AppendText… the problem is already there (before saving the text to disk.

Strange idea:
I selected a whole folder (with a bad report sequence), pasted it in TextEdit: the files appears normally; no error.

The only correct idea to explain the trouble is… a wrong character value, but I do not saw that in the debugger (when displayin the string as binary; the text is ASCII data).

I am out of idea. Someone ?

Did you say strange ? How is it strange !

I created years ago a demo application that dsplay a folder ('till a hard disk) in a hierarchical ListBox.

I dropped a concerned folder and its contents appears in a wrong order just like my analyzing software.

The page displayng order is…
01, 02, 04 thru 52 (omitting 03, 17 and 39)
and at the end, I get 03, 17 and 39.

These files are jpg files saved in 2011. The only change was done yesterday on a M1, the file names were modified.

The other explanation is Big Sur on M1 can modify the items order on non APFS volumes…

Nota: this was possible long time ago (on macOS 6, probably). I even recall the trick to “alphabetize” the order of files in a folder. For obvious reasons, this trick do not works anymore (it involved the Option key… doing so today will duplicate the files, I think).

One more test:
I created another folder,
moved all files from 1 thru the last one,
deleted the previous and now empty folder

Analyze: same behavior.
I moved the folder on a different hard disk,
Moved it back
Analyze returns the same.

Didn’t we already talk about this?

1 Like

Hi Anthony,

not needed.

At last I found from where the error comes:

For unknow reasons, I found a bunch of “non breaking spaces” instead of space. So removing them remove the problem too.

The used code now is…

  For Itm_Idx = 1 To Itm_Cnt
    File_Name = Folder_FI.TrueItem(Itm_Idx).Name
    File_Name = ReplaceAll(File_Name," ", " ")
    Items_Arr.Append File_Name
    If UserCancelled Then Exit

  character can be writen using Option-Space. I do not know if the character in the code above is correct or no. But it is correct in Xojo.

Now I can go to my kitchen, my stomach is crying out loud !

How do I discover where the bug is ?

I replaced all characters of a “bad behavior" file one after one, analyzing the result. I get it after the third attempt.

A better one can be:

File_Name = ReplaceAll(File_Name,Chr(160), Chr(32))

I found 223 files that holds one or more Chr(160) space in their name…