Link to home
Start Free TrialLog in
Avatar of andre72
andre72

asked on

How to check if a directory move had been finished

Hi,

at a webside a user can create a temporary ID for a new document and file uploads.
When the user press Save at the app I do a callback to move the tempoary folder and the uploaded files to the right folder.
string tpath = GetNewId();
string spath = Session["TempId"];
Directory.Move(spath, tpath);

The matter is that the new directory (tpath) will be scanned some commands later and very often Directory.Move hasn't finished than and I get a exception.
So what I need is to wait until Directory.Move has finished all activity or a simular function that can do so.

How can I solve this problem?

Thanks

Andre
ASKER CERTIFIED SOLUTION
Avatar of abdkhlaif
abdkhlaif
Flag of Saudi Arabia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
of course this code should be be placed after you call Directory.Move
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andre72
andre72

ASKER

Thanks