New free cross platform FolderItem library

Hi,

Having spent the last three days trying to work around some pretty subtle and nasty bugs in both the new and classic FolderItem classes I decided to write my own module for robustly handling file/folder moving/copying/deleting. The module is essentially a nice wrapper around the cp and mv commands on Unix systems and the move and xcopy commands on Windows. The source code is available on GitHub, as is extensive documentation.

Let me know if there are any glaring bugs!

Hi, Garry.

Do you have references to these bugs in FolderItem? I haven’t seen them and I’m interested. Feedback numbers or forums threads or whatever you have.

I couldn’t reproduce them reliably but I was seeing repeated failures on Windows 10 with the Xojo.IO.FolderItem.MoveTo and Xojo.IO.FolderItem.CopyTo methods whereby I would get odd errors and failures stating that either destinations were not empty when they should have been (and were) and inexplicable permission errors which just melted away when I used the Shell.

You are aware those are deprecated (like many other ‘new framework’ methodes).

They’re not officially deprecated at all.

nothing from the new framework is deprecated as of yet. The announcement at XDC that they are migrating back to the oldframework was a “its going to happen one day, not today” type of announcement. And I predict that they (Xojo) will merge the good of the new framework with the oldframework. to make a better framework. But nothing is happening overnight. Plus when they do mark something as deprecated, it takes a good long while before it is removed (saying a year is a short interval).

and thanks @Garry Pettet for your hard work.