For the following code:
dim f as folderitem = get_some_folderitem
dim g as new folderitem(f.nativepath,folderitem.PathTypeNative)
Does Xojo guarantee that g will refer to the same folder / file / location as f?
I ask because I seem to remember that this was not always the case with FolderItem.AbsolutePath.
g = f // will point to the same object (file / folder)
Thanks for the reply.
However, I’d specifically like to know:
Does new folderitem(some_native_path, folderitem.PathTypeNative) unambiguously refer to at most one file?
Or are there edge cases (eg. 2 volumes with identical names), where there may exist ambiguity as to which file the resulting folderitem will refer?
Thanks
With two volumes and same name, one will get a -1 in the path on the name.
Why do not try by yourself ?
Your code will result in two FolderItem objects that both point to the same physical file, folder, or drive.
Note that you can simplify that to dim g as new FolderItem( f )
.
Tim_Jones
(Tim Jones)
7
As Christian mentioned, if you have 3 volumes with the same displayed name, you will find that they are actually mounted as:
/Volumes/My Drive
/Volumes/My Drive 1
/Volumes/My Drive 2
So any NativePath entries will include the numeric increment in the path provided.
Thanks for all the responses. That clarified it.