473,383 Members | 1,748 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,383 software developers and data experts.

How to find out length of a physical drive

Hi,
I'm writing an applications that reads from a HDD 1 sector at a time.
I set the file pointer to the beginning of the physical drive using
SetFilePointerEx(), and then increment liDistanceToMove by 512 bytes
after each access. However, I want to know what is the length of the
physical drive so I don't overshoot it. How do I do this?
GetFileSizeEx seems to work on a folder level but my drive is
unpartitioned/unformatted so I need something that works on the
physical level.

TIA.

May 15 '07 #1
2 2148
galapogos wrote:
Hi,
I'm writing an applications that reads from a HDD 1 sector at a time.
I set the file pointer to the beginning of the physical drive using
SetFilePointerEx(), and then increment liDistanceToMove by 512 bytes
after each access. However, I want to know what is the length of the
physical drive so I don't overshoot it. How do I do this?
GetFileSizeEx seems to work on a folder level but my drive is
unpartitioned/unformatted so I need something that works on the
physical level.
Looks like you want a platform specific group.

--
Ian Collins.
May 15 '07 #2
galapogos <gois...@gmail.comwrote:
Hi,
I'm writing an applications that reads from a HDD 1 sector
at a time. I set the file pointer to the beginning of the
physical drive using SetFilePointerEx(),
This isn't a standard C library function.
and then increment liDistanceToMove by 512 bytes
after each access. However, I want to know what is the
length of the physical drive so I don't overshoot it.
The C language standard can't answer that question. As such
your question is basically off topic. You should consult a
group specialising in either the interface you are using,
or the architecture you are working on.

--
Peter

May 15 '07 #3

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

Similar topics

3
by: jeje | last post by:
Hello, I'm programming in C++ with Visual.Net. I'm trying to find the cdrom drive letter but I only can find the CDROM drive letter. I'm using GetLogicalDriveStrings and GetDriveType. If someone...
1
by: t0M | last post by:
It's nearly impossible to find anything on this because of the Dictionary class, included within the dotnet framework, that pollutes any search results pertinent to my question. I want to be...
4
by: cdrom205 | last post by:
static void MDString ( unsigned char *input) { MD5_CTX context; unsigned char digest; unsigned int len = sizeof(input);//strlen (const char*) md5.MD5Init (&context); md5.MD5Update...
6
by: finerrecliner | last post by:
hey everyone i'm trying to make a function that will return the length and width of a dynamically allocated 2D array. here's what i came up with to find width: int findWidth(int** matrix)...
2
by: SSG | last post by:
In my database table , I have field to store the text,.. I am tryinf to find the length of the filed in ASP like below response.write len(rs("cname1")) It is displaying the value , when the...
2
by: mmkhan7 | last post by:
could any one tell me how can i find length of given string in VB
2
Curtis Rutland
by: Curtis Rutland | last post by:
I want to get the actual physical path for some of the Windows Environmental Variables. If I typed %TEMP% into the Run prompt on Vista, I'd go to the folder: C:\Users\username\AppData\Local\Temp ...
0
by: eunalp | last post by:
I'm working on a web service that will update the file content of a web application which is under the same server. The web service and the web application are independent from each other however the...
4
by: babusek | last post by:
How to find Length and Breadth of a Rectangle represented by co-ordinates? example:rectangle represented by (a,b) (c,d) (e,f) (g,h)
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.