the item exists, actually is a Windows share and I have no permission to modify it, but I just need to see if it exists.
The code above get back a valid FolderItem instance, but the Exists property is false.
The same happen for files inside this folder. Can get and read the files, but they are marked as not existing from FolderItem.
search feedback for ‘FolderItem Exists’, and you’ll find: <https://xojo.com/issue/22987>
note that you also can’t rely on: FolderItem.IsReadable/IsWriteable
i’ve seen some windows-environments with some ‘more complex’ file permissions structures (Active Directory, groups-in-groups, …can’t remember exactly…) where you can hardly rely any of these properties…
so all i can recommend is that you try to read the file (write a temporary file to the folder.) if success - you are sure you can read/write.
Seems working, thanks, but Im not sure if its reliable.
In one of my tests I got a valid folderitem, even if the share was not existing.
If I can reproduce this, have to test what happen trying to open a binaryStream and write to it.
[quote=67246:@Massimo Valle]This thing is still creating me a lot of problems.
Anyone know a workaround to this problem?[/quote]
I understand you have no permission to write. But what if you simply try to read a few bytes ? If error you catch, then the file does not exist. Just a thought.
This is what I’ve resorted to on Windows specifically, but I’ve also left it in for Linux and OS X since it’s a “second set of eyes” on the file state. This also catches a permissions setting that used to be missed on Linux back in 2008 or so that I’ve just left in place.
Just a guess here, but I would suspect that the Xojo routines depend on the reliability of the underlying OSes file processing. I’ve run into share access issues on Windows in VC++ using MS’ own APIs.