How to know file is fully copied

Do you “renew” the FolderItem between checks?

f = new FolderItem( f )
if f.IsWriteable then ...

(I still haven’t tested any of this.)

Yes.

The project I’m using for checking can be downloaded:

https://storage.googleapis.com/charlierobin-1245.appspot.com/downloads/file_copy_test.xojo_binary_project.zip

I saw, just have no time to look today (or maybe this week).

My understanding is that it’s not even that, it’s a COW wrapper. The space is simply marked, until the user modified the file, at which point it saves the modified data to that location.

Bear in mind that if the permissions or ACLS prevent writing, it will always return NO for isWriteable. It’s easy to check the file permissions, Xojo has functions for that, but the ACLs are mixed bag, with new ones added for Catalina that are undocumented.

But in the case of file permissions or an ACL making the location non-writeable, then the copy itself should also fail to even start and there should be an IOException or status error in MacFileOperationMBS or whatever – right? And then there is not need to attempt a loop checking if the copy has completed by watching for a change in isWriteable.

Do you flush the file ?

Seems not.

Xojo.IO.BinaryStream ???

Not if you authenticate as another user when starting the copy. E.g.: in the Finder, try to copy a file to a read-only folder (not physically locked, of course); it’ll ask you if you want to authenticate (unless it’s a protected folder by the OS). Authenticate as an admin and the copy will start. Still, your Xojo app would not be allowed for writing to that file.