In article <42***********************@newsread4.arcor-online.net>,
Tony Bansten <to******@hotmail.com> wrote:
Assume I have a partition (under WIn2000/WInXP) which is possibly NOT
formatted with a files system (e.g. NTFS). This could be a partition on an external
USB harddisc.
How do I find out if this partition exist?
The C and C++ languages do not know themselves anything about
partitions. You should ask in a Windows newsgroup.
FYI, there are some traditional approaches to this problem --
approaches which might or might not be applicable to Windows:
a) Wander through the operating system's mount table to figure out
whether the partition is -already- mounted
b) Ask the operating system to mount it for you. If the response
is that it doesn't exist, then you know it doesn't exist.
If the response is that you don't have permission to mount it,
then you need to know the OS-specific checking sequence: on
some OS's, it would be an indication that it has determined that
a filesystem is there, whereas on other OS's, it would be an
indication that you don't have enough privilege to mount -any-
filesystem.
c) Research technical details about each filesystem type you
might want to deal with. Ask the operating system to allow you raw
access to the blocks that make up the partition. Check through
the blocks, looking for the "magic numbers" that signal various
different filesystem types. Note: on Unix systems, you would
normally be disallowed access to the raw partition blocks unless
you were privileged; I don't know whether the same is true for Windows.
--
"I want to make sure [a user] can't get through ... an online
experience without hitting a Microsoft ad"
-- Steve Ballmer [Microsoft Chief Executive]