Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > [Win32] HEEEEEEELLLLPPPP! I need to determine the cluster size on WinXP/NT/2k

Reply
Thread Tools

[Win32] HEEEEEEELLLLPPPP! I need to determine the cluster size on WinXP/NT/2k

 
 
Sylwia
Guest
Posts: n/a
 
      04-14-2004
Hi!

I need Your help. I implement a Python NT service and I need to
determine (on WinXP/2k/XP) a cluster size of the particular partition
(to find out how much space a file will occupy on that partition).

Till now I faced the following problems:

- The GetDiskFreeSpace() function is reliable in deriving cluster size
if it is a FAT16 drive. If it is a FAT32 drive, the Win32
GetDiskFreeSpace call is lying about cluster size.

-The newer GetDiskFreeSpaceEx call returns total and free space on the
drive, but does not provide a cluster size parameter at all!!!

-There's a small table that summarizes the default cluster size for
every range of FAT32 volume sizes, but there's no guarantee that the
user accepted the default when creating the partition (((

- There is a DOS function, Int 21h Function 7303h Get_ExtFreeSpace
(FAT32),
but it exists only in Windows 95 SR 2 and later. This can be called
through VWIN32.VXD using DeviceIoControl (unfortunately VWIN32 is
Win9x/Me specific driver and it's not available on Win2K/XP).

So is there any API that gets the FAT32 cluster size correctly in
WinNT/2k/XP?
Does anyone know of an API function that can tell me how much space a
file will occupy on the disk? It'll need to work with FAT, FAT32, and
NTFS.

Thank You in advance!

Farraige
 
Reply With Quote
 
 
 
 
Peter Hansen
Guest
Posts: n/a
 
      04-14-2004
Sylwia wrote:

> So is there any API that gets the FAT32 cluster size correctly in
> WinNT/2k/XP?
> Does anyone know of an API function that can tell me how much space a
> file will occupy on the disk? It'll need to work with FAT, FAT32, and
> NTFS.


It appears you are quoting much of your information directly
from this page:

http://www.techweb.com/winmag/librar...1/howto110.htm

The author appears to have reached the conclusion that there is
no workable solution for NT and friends...

-Peter
 
Reply With Quote
 
 
 
 
Dennis Lee Bieber
Guest
Posts: n/a
 
      04-14-2004
On 14 Apr 2004 08:37:41 -0700, http://www.velocityreviews.com/forums/(E-Mail Removed) (Sylwia) declaimed the
following in comp.lang.python:

> Does anyone know of an API function that can tell me how much space a
> file will occupy on the disk? It'll need to work with FAT, FAT32, and
> NTFS.
>

And what is it supposed to report on a compressed partition?
Until you compress the file, you won't know how much space it needs...
So far as I know, compression is done in a stream fashion as you write
the file to the drive.

--
> ================================================== ============ <
> (E-Mail Removed) | Wulfraed Dennis Lee Bieber KD6MOG <
> (E-Mail Removed) | Bestiaria Support Staff <
> ================================================== ============ <
> Home Page: <http://www.dm.net/~wulfraed/> <
> Overflow Page: <http://wlfraed.home.netcom.com/> <

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Mark B ASP .Net 2 09-11-2009 07:09 AM
Can we determine stack size & Heap size at runtime ? sunny C Programming 5 08-17-2006 12:17 AM
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. Dhruba Bandopadhyay ASP .Net 1 05-25-2006 01:06 AM
accessibility: possible to determine browser-chosen point size of a relative font-size? Timo Javascript 1 06-14-2004 02:36 PM
cluster size LO&MsLO Computer Support 1 02-07-2004 02:31 PM



Advertisments