dim theme as Xojo.IO.FolderItem
theme = Xojo.IO.SpecialFolder.GetResource("primary")
theme.CopyTo(root.Child("themes"))
Where root is defined elsewhere as a Xojo.IO.FolderItem. Also root.Child("themes") exists before the copy is attempted and primary is a folder that is copied to the app’s Resources folder via a BuildStep on both Windows and macOS. Running this in debug mode, the debugger stops at the second line above with a RuntimeException. No message/reason is given just an error code: 102. I have tried this on three PCs (all running Windows 10) and have tried running Xojo as an administrator. This also happens using the remote debugger.
If I inspect theme and root in the debugger, then it tells me they also exist and are writable and readable.
Is this some sort of Windows 10 bug? Having no issues whatsoever on macOS.
Are you trying to copy a file INTO the resources of an app thats been installed (perhaps in a place like C:\Program Files) ?
Is the app open and that file is busy ?
[quote=339964:@Norman Palardy]Running as admin should be sufficient
Antivirus blocking the copy ?[/quote]
Nope, no antivirus or Windows defender. I just don’t get it. I wonder if it’s something to do with the fact that theme uses the Xojo.IO.SpecialFolder.GetResource method? I know it’s not a permissions issue (even though that’s what error 102 is) because I am able to write folders and text files to the root Xojo.IO.FolderItem. It only seems to fail when copying a folder…
Nope, no antivirus or Windows defender. I just don’t get it. I wonder if it’s something to do with the fact that theme uses the Xojo.IO.SpecialFolder.GetResource method? I know it’s not a permissions issue (even though that’s what error 102 is) because I am able to write folders and text files to the root Xojo.IO.FolderItem. It only seems to fail when copying a folder…
This smells like a bug in the Xojo.IO.FolderItem class…
I’m trying to copy a folder in the App’s Resources folder (put there with a build step from the IDE) called primary to a folder called themes in a folder called root. There are a bunch of folders and files in primary. One of which is called post.html.
This fails with RuntimeException 102:
dim theme as Xojo.IO.FolderItem
theme = Xojo.IO.SpecialFolder.GetResource("primary")
theme.CopyTo(root.Child("themes"))
This works:
dim theme as Xojo.IO.FolderItem
theme = Xojo.IO.SpecialFolder.GetResource("primary")
theme = theme.Child("layouts").Child("post.html") ' this happens to be a random file (not a folder)
theme.CopyTo(root.Child("themes"))
Is there a known problem trying to copy a folder into another folder using Xojo.IO.FolderItem on Windows 10 or am I doing this wrong?