473,399 Members | 3,656 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

How do I find out if drive (possibly WITHOUT file system) exists?

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?

Notice that "normal" program code that refers to the root directory or a file system do
not work.

The C++ or C code should use not use .NET functions.

Tony
Aug 4 '05 #1
1 2675
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]
Aug 4 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Matthias Ludwig | last post by:
I'm trying to create a directory on the web server with a vb.net code: .... Dim dirName As String = "w:\filepath\images" If Not Directory.Exists(dirName) Then...
1
by: Tony Bansten | last post by:
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...
2
by: Zeno Lee | last post by:
I'm using File.Exists to test a file on my C: drive. My program was strongly named and had caspol -af run on it to allow it to run from the network. There are 3 ways I am doing this: 1) Run...
2
by: Peter O'Reilly | last post by:
I am experiencing difficulty access a mapped network drive in an ASP.NET application. While using the .Net framework v 1.1 implementation of System.IO.Directory.Exists(), it fails to recognize a...
5
by: Tom Vogel | last post by:
Creating a subfolder within my ASP.NET application folder fails with the above error, but only at my hosting provider. The command: Directory.CreateDirectory(path) Path is set to...
8
by: Michael | last post by:
I am running a web server (IIS) on Windows 2003 SP 1. My ASP.NET C# applications run fine. However, my application is a combination of Classic ASP and C#. For some reason when you attempt to...
2
by: createdbyx | last post by:
I am trying to make a file sync utillity to sync files between my laptop and my desktop pc. On my desktop machine (xp pro sp2) I have shared my "Visual Studio Projects" folder using windows simple...
1
by: tanya.wang | last post by:
I want to access files from a remote server so I mapped it in my server under z:\ for \\myserver\web\mysite\images\ I added this UNC path to my IIS virtual directory and name it as "upload" but I...
3
by: Alexander Vasilevsky | last post by:
Here, there is a challenge: to find the files must be on a local computer, have the same names. Get drives and folders to go through without problems. But what and how to store files while a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.