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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
of course this code should be be placed after you call Directory.Move
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks