FolderItem.Parent on removable volume

CetElt is a FolderItem which can’t be Nil
SepAbsPath is a String character separator of path (":" on Mac and “” on Windows and “/” on Linux)
TampText is a String which contains the Path of CetElt (same as if I do TampText : CetElt.AbsoluthPath

TampText = CetElt.Name If CetElt.Directory Then TampText = TampText + SepAbsPath CetElt = CetElt.Parent While not(CetElt = Nil) TampText = CetElt.Name + SepAbsPath + TampText CetElt = CetElt.Parent Wend MsgBox TampText
If CetElt is a FolderItem on a removable volume and this volume has been ejected, then While Wend never finish.
If I pause the Debug, it indicate nothing for CetElt but that CetElt.Parent is Nil.
A workarround is to test CetElt.Parent.Name , if it’s “” then I exit the loop.

Before report the Bug, I would like to know if I misunderstood something.
I’m running the last Xojo version with Mac OS X El Capitan 10.11.6 (15G1510).

Edit : I read old note in my program and I wrote long time ago that if I do CetElt.AbsoluthPath when CetElt was on an ejected volume it freeze the application (same problem then).

I do not think so.

When the parent of a FolderItem is Nil it means you already get the top FolderItem (the folderItem of the root Hard Disk, MemoryKey, CD/DVD/BluRay, whatever).

IMHO.

In the docuentation (FolderItem.Parent) it is said:

It returns Nil if this item is the root.

If the volume is mounted, I obtain the string path for CetElt : “MyVolume:MyFolder:MySubFolder:MyFile.txt”
It works well, I finish the loop when I’m to Volume as its parent is Nil.

If I eject the Volume after have defined CetElt to the item on this volume, I obtain “::::::::::::::::::MyFile.txt” infinitely.

On a Mac the delimiter is a slash and no colon. So your path should be “/MyVolume/MyFolder/MySubFolder/MyFile.txt”.

unless you got the absolute path which is still reported in the old style

and yes if you get a folderitem to a file on a removable
then eject the disk
you get this weird behavior

Norman, is it a bug I should report?

TampText = “::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::TestLOD01.txt”


CetElt.Exists is not True neither than False. And CetElt.Parent is Nil but my loop continue !?

When I stop the Debuguer it doesn’t, I have to force MyApplication.Debut to quit.

you could
include the images

I just spent 15 minutes to submit in FeedBack bit it crash when I clicked submit :-/ .
And FeedBack doesn’t want to re-login me and re-connect.

I’m boring to submit it again. And if I submit a link to this thread, it will be rejected?

Edit : Ah, it logged me and it automatically ask me to submit the case I entered (it recovered it). Well done, FeedBack is a great app :slight_smile: .

https://forum.xojo.com/41824-feedback-2017r1-2/0#p340070