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

how to get exact file location?

I would like to know if there is anyway to get the exact
file location on a harddrive? For instance, you pass a
filename and you can then get the head, track, sector,
etc.. of the file (and its parts if fragmented)?

It would be best to do this in dotNET, but it isn't
necessary.

Thanks,
Kory

MSDN Subscriber
Jul 21 '05 #1
2 1432
I am pretty much sure the .NET framework class libray doesnt provide details
of the file to this level. You will have to lower level API's (if available)
and hence use P/Invoke services from .NET.

--
HTH,
Manoj G [.NET MVP]
http://www15.brinkster.com/manoj4dotnet
"Kory Postma" <ko****@microsoft.hotmail.com> wrote in message
news:05****************************@phx.gbl...
I would like to know if there is anyway to get the exact
file location on a harddrive? For instance, you pass a
filename and you can then get the head, track, sector,
etc.. of the file (and its parts if fragmented)?

It would be best to do this in dotNET, but it isn't
necessary.

Thanks,
Kory

MSDN Subscriber

Jul 21 '05 #2
Do you happen to know of any low-level APIs to do this? I
know of DeviceIOControl but that is only for hard drive
information, not really for getting file locations. How
does defrag programs do it? I hope that don't read and
translate the FAT or NTFS, I would think there would be an
easier way.
Thanks,
Kory

MSDN Subscriber

-----Original Message-----
I am pretty much sure the .NET framework class libray doesnt provide detailsof the file to this level. You will have to lower level API's (if available)and hence use P/Invoke services from .NET.

--
HTH,
Manoj G [.NET MVP]
http://www15.brinkster.com/manoj4dotnet
"Kory Postma" <ko****@microsoft.hotmail.com> wrote in messagenews:05****************************@phx.gbl...
I would like to know if there is anyway to get the exact
file location on a harddrive? For instance, you pass a
filename and you can then get the head, track, sector,
etc.. of the file (and its parts if fragmented)?

It would be best to do this in dotNET, but it isn't
necessary.

Thanks,
Kory

MSDN Subscriber

.

Jul 21 '05 #3

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

Similar topics

11
by: Skc | last post by:
I have a .txt which has been exported as a .csv from an external source. What i need to do is to import this into SQL2000 (into a table) but I need to do special things on the data: 1. I need to...
4
by: YS Sze | last post by:
If you know the exact longitude and latitude for a specific location, would anyone think it'd make any sense to find out if this set of location numbers is really part of the Fibonacci series or...
4
by: Arif | last post by:
My programs searches the header of input barcode in index file. Get the record position next to Barcode header. Then moves the file pointer of products file to reach that record. My products...
8
by: Daniel Bauke | last post by:
how i can retrieve an exact url typed by user in a browser? in particular i'd like to get http://foo.bar.com/ without default content page defined in 'Documents' section in iis. i can't find proper...
2
by: Kory Postma | last post by:
I would like to know if there is anyway to get the exact file location on a harddrive? For instance, you pass a filename and you can then get the head, track, sector, etc.. of the file (and its...
10
by: Peter Olcott | last post by:
Someone told me that determining the exact location and current state of any JavaScript controls is pretty easy. Does anyone know exactly how this is done?
13
by: Marc | last post by:
The first part of the below writes the name and location of all buttons on a from to a text file. The second part reads that information back in and recreates the buttons. My problem is reading...
5
by: mmcd79 | last post by:
I built a VB.net application that makes use of a machine level DB connection string setting, and a user level starting location setting. The machine level setting and the default user based...
5
by: Andy B | last post by:
I have 2 TextBoxes and an Add button on a page. When the user fills in the TextBoxes, the values are added to a dataset table. When the page gets done reloading, the TextBoxes are turned into...
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: 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?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.