Detect if a folder is locked
-
In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error. Can If a folder in windows file systemis locked befor performing these operation programmatically. Can some one suggest some shell API or SDK function to do the job
Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)
-
In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error. Can If a folder in windows file systemis locked befor performing these operation programmatically. Can some one suggest some shell API or SDK function to do the job
Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)
Have a look at the
CFile::Open()
method. If it returns zero, then the pError parameter in it will have a description of the error.Nobody can give you wiser advice than yourself. - Cicero
-
In windows exporer if I open a file say "text.doc" present in "C:\office docs" folder. Now when performing operation lre renaming,moving or deleing that folder in windows will return error. Can If a folder in windows file systemis locked befor performing these operation programmatically. Can some one suggest some shell API or SDK function to do the job
Sudhir Mangla http://Programmerworld.net AND http://DevelopersVoice.com (Free books , articles , Source Code and Programming Tools and Utilities)
The folder is not locked. It is file which is locked as opened and sanity checks for move,delete operations returns failure, because some/one file cannot be removed. What system really does when you order it to move folder, is to copy & delete every single file in folder, and when error occurs (like when file is opened), an error message is displayed, but folder is never being locked. Regards