Possibility to check if the files to be stored in the cab are ready

When working with large files like several 100 MBytes and first collecting the files in a folder its hard to know when they are ready to be stored in the cab. If I'm to early I get "in use by another process".
Now I'm using Sleep() that makes it slow even if the files are small. If I could check if the files are ready or the component could do that by it self or something like that would be nice.