I have a function but on Mavericks, it crashes the app on the .Parent call. This is when it’s looking on a CD with perhaps some hidden folders/files involved,
0 libsystem_c.dylib 0x90a4a785 strlcpy + 53
1 com.apple.CoreServices.CarbonCore 0x976d8901 UTF8ToFSSpecName + 50
2 com.apple.CoreServices.CarbonCore 0x9767706d FSRefCreate + 423
3 com.apple.CoreServices.CarbonCore 0x97677510 PBGetCatalogInfoSync + 1025
4 com.apple.CoreServices.CarbonCore 0x97677107 FSGetCatalogInfo + 53
5 rbframework.dylib 0x0155f75d FolderItemImpMac2::FolderItemImpMac2(FSRef const&) + 189
6 rbframework.dylib 0x01560a96 FolderItemImpMac2::GetParent() + 62
7 rbframework.dylib 0x015bb98f folderParentGetter + 33
8 com.chickensys.translator6 0x000cb0d5 FolderItem.Parent.Get%o%oi4 + 85
9 com.chickensys.translator6 0x0087ff85 basEmuX.$POSIXPathRCS%s%o + 894
Here’s the code. Please never mind about an easier way to do this particular thing - the concern I have is that the REAL function .Parent crashes the whole app. This is with REAL2011r3 - and I know that the bug can’t be fixed, but I am looking for a way to work around it. I’m confident FolderItem.Parent works fine generally, this is probably just regarding the the hidden object/CD situation. Still, the REAL function in rbframework.dylib looks vulnerable.
This particular instance is particularly important because it has to do with my authorization routine for all my apps I sell.
[code]Function POSIXPathRCS(extends f as FolderItem) As String
Dim Msg As String
Dim EmptyStrCtr As Integer
Dim ThisName As String
Dim f2 As FolderItem
If f = Nil Then
return ""
Else
f2 = f
Do
ThisName = ReplaceStringAll(f2.Name, "/", ":")
// checks bad volumes
If ThisName = "" Then
EmptyStrCtr = EmptyStrCtr + 1
If EmptyStrCtr > 4 Then
Msg = "/Volumes" + Msg
Exit Do
End If
End If
Msg = "/" + ThisName + Msg
f2 = f2.Parent
// means the root
if f2 = Nil then
Msg = "/Volumes" + Msg
Exit Do
End If
Loop
return Msg
End If
exception err
WriteExceptionLog(err, CurrentMethodName)
return Msg
End Function
[/code]