The used code: Page_Names() = m2aa_Apha_Sort(Page_FI)
works on most checked directories excep some where the returned value is 0.
2. I have a case a file I get for code some line below the shared one does not appears; I set a — at the end of the file, then before the extension and I get the file. But not always.
In this case, this trick does not always works (the file name is not processed).
NB: the file can be a png or a jpg and I am able to open it / show it from the Finder.
But if you have a directory with a file count of 0, did you save these files in there recently, and the folder is synched with iCloud?
Sometimes I have seen incorrect results while synching is happening.
I set a — at the end of the file, then before the extension and I get the file.
There are several characters that look like a dash. Are you using the right one?
the file can be a png or a jpg and I am able to open it / show it from the Finder.
(If on a Mac)
Have they been grabbed by the Photos app?
If so, opening from Finder works, but I have found that apps written in Xojo do not see those ‘stubs’.
Short answer: I scan 17 folders in the current master folder, and only some returns nothing (except all the folder names).
I rebooted some times, fired SOS Disk.
I noticed some months ago that sometimes the file rename was not took into account. The — (Option–) usually placed after the file extension then removed “cure” the trouble (the file become visible).
I do not sure at 100%, but I think I never used the Photos application.
The only thing I have not tried is to move the folder contents in another folder.
I use a Windows icon to store the generated summary (Sommaire in French)
Here’s a screen hot of the master folder to give you an idea.
The folder that ends with " - Data" are ignored.
I have checked the first ros of folders (7), and I just noticed an error in a folder from the second row.
BTW: I used the word Directory because this is the word used in the debug → FolderItem. isRead and isWrite are True.
charlie mensuel 042 is the one who do not have a single file reported.
I have to check if all files named charlie mensuel 0xx - 001 appears everywhere in their respective folder.
I even make a copy in an external SSD without getting change. (I copy the whole folder for the occasion, then I remove it).
So most of the ‘Mac’ advice is not relevant.
I note that for obvious reasons, some of the folder names contain accented characters.
Is there a chance that you are not dealing with Unicode names correctly?
certainly ‘changing the name makes the contents visible’ sounds very like a cloud synch issue to me.
All folders have one or more vowel with diacriticals. So it’s probably not the case. But I can rename temporarily the folder that its contents is skipped…
Cloud: I will set the wifi off and try. but if this is the reason, I do not know at what moment the cloud have been enabled on my machine.
There’s more than one way of generating characters with diacriticals, it could be that Finder is using one method and your code another. For example é can be a combining accent followed by an “e”. Another way is to have a single character with everything in it. Each has its own unicode representation.
I would kinda expect a FolderItem to return what ever Finder had in place, but perhaps it isn’t for some reason. Are you getting the folder name from scanning a directory or by copy and pasting it into your application.
I remember we discussed exactly about that with Emile, some months ago, and we told him to copy the file name straight from the Finder and paste in his code to avoid such differences. So either (and hopefully) this isn’t the same problem this time, or it’s a hard habit to forget.
Emile, out of curiosity, when you have a count of 0, does the “exist” property show true?
Scaning the directory, putting the names in an array, sort the array and build a new Folder and use that.
I know it is not easy, but @ my place it is far worst due to the hours I waste with that problem (and other not computer related).
Then, once the folders are scanned, I have two methods that scan the code to build the Tavle of Missing and Table of Contents and all folders appears.
The structure of data is:
a. a Master folder (the screen shots)
b. a Child holding the data (zip archive and a folder with all files).
c. a Grand Grand Child that are the files in the Child Folder
One on 17 folder have troubles.
Cases b and c must share the same name AND share the same (Copy / Paste).
Why not ? I set mine in the Finder, not in code (French locale is used when manipulating file names).
That’s it - else I ould have to do one application per Master Folder.
Master Folder: think that folder holds a book Collection (Geo, National Geographics, The Complete Shakespear Artwork, etc.)
Where the Master Folder is for example:
Master Folder name “The Complete Shakespear Artwork”
Child 1 to Child X are a set of folder for each published book.
Grand Childs in each Child holds:
Description of the book (title, publication date, Editor, Company editing it, Country, etc.
Front Cover description
Table Of contents
Each Chapter is commented
Last Cover description
This description does not appears on one folder (book in the above example.
I had some missing covers, but with the rename trick, they appeard back.
This erratic way of report the data exists here well before Sequoia.
One time, it was fully working if the Master Folder resides in an external SSD… (or HDD, but external)
At this point you are sorting Xojo strings, not necessarily the actual name of the folderitems.
If you read in the name, and the accented characters are lost or changed due to UNicode, then using the Xojo string to ask for it afterwards will fail.
eg (very extreme /unreal example)
Folder names are
ZYXẽ123
ABCö123
when they are in Xojo strings, they maybe become changed.
ABC^&$123
ZYXẽ123
So if you use the changed values.. problem.
Maybe try using Sortwith
If you use an array of Folderitems, the references will be valid
var folderitems() as folderitem
var itemnames() as string
For x as integer = 1 to bigfolder.count
if bigfolder.item(x).exists and bigfolder.item(x).isfolder then
//it is a folder, so add it
folderitems.add(bigfolder.item(x))
itemnames.add (bigfolder.item(x).name)
end if
next
itemnames.SortWith(folderitems)
//At this point, you should be able to use the sorted folderitems array directly
Now to be fair, this may have no bearing on the problem at all but it will eliminate any issues caused by using file names for sorting.
OK Jeff, and thank you for your explanation. But all folders holds diacritical wovel and I have the trouble with only one for reading the grand child folder that have the same name as its parent.
I will work on it right now, finishing to check if the data are complete (in the Finder, then reported correctly by my project).
the only diacritical there is ‘à’ (a acute). but this exists on all other folders… (not checked with Xojo, just the issue with troubles).
It is in line $50: 3820.a...H3846.
I have deleted some of there characters and carefully retype them.
Running the project and…
Nothing changed.
I continue the quest.
To get a better idea of the results/lack oc result here’s the generation of two folders (issues 42 and 45:
The project “only” do that: generate a html file, so stripping its contents have no sense, in this case if I remove something, it will not work anymore.
My last idea (that appears as stupid, but I am already far beyond that stage) was the good one and I have to move the other files…) was to create a new folder with the original name and move the data folder / rename it.
Once done I run the project and it does not works.
OK. I gave up for now. I will come back in this project later in the week when I will have a brand new eye (!).
I’m sure I am not the only one struggling to understand what you (Emile) have tried , and what the results are (other than ‘it does not work’)
If you can zip up a folder containing (eg) 2 folders which work, and 1/2 which do not, then post that with some code that demonstrates the problem, I feel confident that someone will be able to see where the trouble lies.
Right now, we are guessing.
I do not know what can the problem be, but:
I copied the folder name,
Pasted in the Xojo Code editor,
Copy from the Xojo Code editor,
Paste as the new name of the offending folder (the not working one), run the project, select the master folder and… get the missing desciption.
How could I set a gremlin character into the files/folder names, I do not know (or is it the SSD that is starting to have troubles and Disk Utilities deoes not correct ?
I marked it as the Solution, but I do not understand.
PS: I still have the “non working” folder (on an external SSD) and I can share that.
And… a last more thing: I cannot strip anything from this 97KB project; this is a one window / one 128 x 128 icon / one button / one TextArea, auto save project.
So a name you copied from the Xojo editor, works with Xojo code.
That does sound like one or more characters had changed when brought into Xojo
Glad you have a solution for now. (It may happen again)
The sortwith() solution would avoid future issues like this, because instead of referring to a file later by its name, you can do straight to the folderitem itself.
I knew that Xojo IDE remove weird characters (with AND without asking if we want to remove gremlins), that is why I tested that (once I recalled that feature).
I just recall that I the folder name as hex (in an image) and there is only a UTF (à on 3 characters as 61 CC 80) character. I rejected the idea te error can be there because I have that à in ALL other folders.
I do not know.