FolderItem -- Check for copy in progress

Is there a method on the Mac side to check whether a FolderItem is currently being copied into that location by the Finder?

I want to iterate through everything in a folder, but ignore any items that are in the process of being written so that the application doesn’t prematurely try to process incomplete items.

Does the file size need to be checked multiple times in order to see if it remains the same, or is there another way?

Thanks for the help.

Checking file size is a way to do it but not 100% reliable.
FolderItem.MacType returns ‘brok’ when it’s being copied but it’s deprecated and I’m not sure how to make it work with the mentioned UTI replacement.
I filed a feature request <https://xojo.com/issue/43233> a few weeks ago but don’t have much hope. :confused:

Thanks for the input Marco.

I once wrote a function which tried to open file exclusively. If that fails it is open by another app.
If you are interested I could tonight look for it.

[quote=266206:@Christian Schmitz]I once wrote a function which tried to open file exclusively. If that fails it is open by another app.
If you are interested I could tonight look for it.[/quote]

A bit more detail about what I’m doing with the application before you go through unnecessary work looking for code that might not work in this case.

I am displaying images from subfolders within a folder on canvases to create a slideshow. The parent folder is polled periodically for new subfolders so that it can display the newly added images. I am trying to skip over any subfolders that are in the process of copying so that the application doesn’t prematurely try to display their contents.

I think that I might be better off using the FSEventsMBS class to monitor the parent folder for new contents, but if there was an easy way to skip incomplete folders it certainly requires less code.

Thanks for the help.