When I create a FolderItem, it is frequently created with LastErrorCode = 101 (Not found)
dim tempSave as FolderItem
tempSave = destinationFile.Parent.child(fileName) // DestinationFile is a pre-existing file. We want to save in the same directory as it.
However creating a TextOutputStream with the FolderItem still seems to work.
That sounds normal if the save file doesn’t yet exist. You get a valid folderitem pointing to a not yet created (potential) file, so since it doesn’t exist, it should have a Not Found code.
[quote=479039:@Tim Hare]
That sounds normal if the save file doesn’t yet exist. You get a valid folderitem pointing to a not yet created (potential) file, so since it doesn’t exist, it should have a Not Found code.[/quote]
You’re probably right though FolderItem.Exists = false makes sense but for it to log an error on creation seems odd…
Well, it has to look up the file to check for existence, so the last error code is whatever the OS reported. But I would ask, why are you checking LastErrorCode at this point anyway? It won’t have any useful information.
It may be a permissions issue. It looks like you’re asking the user for a location to save the file but not actually using it. There isn’t enough code for me to know for sure, but I would definitely start there - especially on Catalina.