itnifl
asked on
Copy-Item, Move-Item, Test-Path and locking the file until complete
I am using the cmd'lets Copy-Item and Move-Item to move or copy files from one location to another. I then use Test-Path to verify that the file has arrived. But sometimes there is another system on the receiving end that moves the files to yet another location before the Test-Path cmd-lets gets time to verify.
Is there any way to lock the file until Test-Path has done it's job? Or in any way ensure that the any other system does not move the files before Test-Path has run?
Is there any way to lock the file until Test-Path has done it's job? Or in any way ensure that the any other system does not move the files before Test-Path has run?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
And I was thinking of creating a new cmd-let or function that would use system.io in .Net and lock the file until verified on the other side. Glad I don't have to :)