Can I get a handle to the root of logical drive?
-
Hi I am interested to get a handle to the directory that consists the root of a logical drive. E.g. I want a handle on C:\ I noticed that FileFirstFile will refuse to give me back such handle. Also do time attributes (i.e. creation, modification, last access) have any meaning for the root directory? They certainly have meaning for the subdirectories but what about the root. Thanks for any given help Simple questions...
-
Hi I am interested to get a handle to the directory that consists the root of a logical drive. E.g. I want a handle on C:\ I noticed that FileFirstFile will refuse to give me back such handle. Also do time attributes (i.e. creation, modification, last access) have any meaning for the root directory? They certainly have meaning for the subdirectories but what about the root. Thanks for any given help Simple questions...
The
GetFileAttributesEx
function retrieves attributes for the specified file or directory. Probably what you want to know. -
Hi I am interested to get a handle to the directory that consists the root of a logical drive. E.g. I want a handle on C:\ I noticed that FileFirstFile will refuse to give me back such handle. Also do time attributes (i.e. creation, modification, last access) have any meaning for the root directory? They certainly have meaning for the subdirectories but what about the root. Thanks for any given help Simple questions...
Simply use:
HANDLE h = CreateFile("\\\\.\\C:", ...);
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown