Store File to iCloud?

Files are locked while the sync is going on, so yeah, there can be a delay. IIRC, there should be a way to pause the sync of an item so you can operate on it immediately, but certainly you should be able to move it out of the cloud folder first (maybe to temp) before trying to delete it.