Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple folder size calculator
Message
 
À
08/08/2007 11:36:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01246791
Message ID:
01246816
Vues:
22
Hi,

> If I knew the size in bytes I could subtract that from diskspace() to see if there is enough room.

Why would you need to do this? I'm asking, because it's not as easy anymore.

First of all, there's no relation between file size and storage space. You can store 250 GB of files on a 200 GB hard drive, or you can have 100 GB of files on the same disk and not enough space for a 10 KB file. There are several factors that contribute:

1) Files are stored in clusters which is the minimum allocation size. The cluster size can vary from disk to disk.

2) NFTS files consist of multiple streams that allocate additional space that is not part of the file size. That's true for permissions, property information as well as streams of certain third party tools. Kaspersky creates a stream for each file.

3) NTFS doesn't use files only. On an NFTS system you can have all kind of stuff. For example, you can create files that do not occupy any space unless you try to read from them. Then the files are actually created. This happens with the setup wizard in many cases. Or you can create links, even cyclical ones. Hence, you might count the same file several times.

4) Files can be encrypted and compressed. Both affects the actual storage size.

5) You can limit the amount of space per user called a quota. In this case you only see the quota as free space. If you create files as a different user you might have a different amount of space available on the same machine.

6) You might not have the permission to scan all files in the folder.
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform