Article View: borland.public.cppbuilder.nativeapi
Article #5071Re: How much of the free space of a device goes away after creating a new file on it?
From: Bob Gonder
Date: Mon, 07 Nov 2005 17:50
Date: Mon, 07 Nov 2005 17:50
31 lines
2285 bytes
2285 bytes
MR <> wrote: >I want to find out if there is enough space on a harddisk-partition >(FAT32 or NTFS) to copying some files into it. > >I was (and am) a little confused, that the free space on this >partition did not change at all. As tinyabs mentioned, NTFS saves small files directly in the directory entry, so you won't see any disk usage until the directory needs another cluster. >How can I find out how much of the free space of a drive f: would go >away if I copy a file (from within a program) to it? The maximum amount of space would be the size of the file, rounded up to the nearest cluster (plus one cluster for directory expansion). This is what you should test for. Unless you have very specific needs to squeeze onto a disk if at all possable, then err on the conservative side, and check for the maximum amount. OTOH, if you really need to squeeze in, then just start copying, and deal with the out-of-space when it occurs. >Also how much of the free space of f: would go away if I create a >directory on it? In general, one cluster. But if you place a lot of files in there, then more cluster are used. The number of file entries per cluster depends on the cluster size, and the file system in use, and in some cases, the size of the file name.
Technical Details
Message-ID:
<474vm1hlqlad2cm9igr54pe0hc85ck4omb@4ax.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<hj0tm1da9kj6dd2bu8qkj46ecnpfth0gr6@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,50a6f477f82717f3 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: How much of the free space of a device goes away after creating a new file on it? Date: Mon, 07 Nov 2005 09:50:59 -0800 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <474vm1hlqlad2cm9igr54pe0hc85ck4omb@4ax.com> References: <hj0tm1da9kj6dd2bu8qkj46ecnpfth0gr6@4ax.com> X-Newsreader: Forte Agent 1.93/32.576 English (American) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 71.49.213.180 X-Trace: newsgroups.borland.com 1131385836 71.49.213.180 (7 Nov 2005 09:50:36 -0700) Lines: 33 Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail