S
sidd
hiAll,
is there a way in .net/c# to check if a file is in use with another
process.
so i am trying to do a File.Move(source,destination)..and if the file
is in use, this would through an error..System.IO.IOException..
so before i try to move the file i some how want to check if the file
is in use..if it is then i will make cuurent thread sleep for couple
of minute an then retry....
1)i wanted to accomplish this without using try catch block,if
possible
2)if it's not possible to do it without using try catch block then
also i have some question..
the exception type you get in cathc block is generic
System.IO.IOException.....this exeception could be thrown for several
reasons NOT just because the file is in use with some other
process....
other than parsing the error meassage to look for a string like 'in
use with other process' ....is there a better clean way of doing this?
thanks
siddharth
is there a way in .net/c# to check if a file is in use with another
process.
so i am trying to do a File.Move(source,destination)..and if the file
is in use, this would through an error..System.IO.IOException..
so before i try to move the file i some how want to check if the file
is in use..if it is then i will make cuurent thread sleep for couple
of minute an then retry....
1)i wanted to accomplish this without using try catch block,if
possible
2)if it's not possible to do it without using try catch block then
also i have some question..
the exception type you get in cathc block is generic
System.IO.IOException.....this exeception could be thrown for several
reasons NOT just because the file is in use with some other
process....
other than parsing the error meassage to look for a string like 'in
use with other process' ....is there a better clean way of doing this?
thanks
siddharth