|
|
|||||||
How come that the following script is reporting the same size for dir1 as dir2 ? Am I missing something here ? Both dirs exist though... SIZE.KIX Open( 1 , "size.csv" , 5 ) WriteLine( 1 , "dir1;" + GetDiskSpace("F:\DIR1") + ";" + @CRLF ) WriteLine( 1 , "dir2;" + GetDiskSpace("F:\DIR2") + ";" + @CRLF ) Close ( 1 ) SIZE.CSV dir1;43303784; dir2;43303784; |
||||||||
|
|
|||||||
Hi rheffels, Welcome to the korg, I believe what is going on, is that ‘GetDiskSpace(< drive letter >:)’ is not designed to look at directories, it only looks at drives and because both dir's you have there are both on drive F. You could try fnGetFolderProp(). I think it will get you what you are looking for. |
||||||||
|
|
|||||||
That's what I thought, but that's not what it says in the command reference http://www.kixtart.org/index.asp?p=commandRef#_Toc146265755 "On Windows NT and on Windows 95 OSR2 and later versions, Drive does not have to specify the root directory on a disk. On these platforms, the function accepts any directory on a disk." And it doesn't work on Windows XP Professional and Windows 2003 Server. So... Is it a bug or something ? :-) |
||||||||
|
|
|||||||
You mis-understand the comments in the manual. Although you can supply any directory, it is still the drive space that is returned. If you read through it again you will see that it never says that it returns directory space. It only refers to returning drive space. |
||||||||
|
|
|||||||
Here is the direct link to fnGetFolderProp(). |
||||||||
|
|
|||||||
Ah, thanks for the function, it works ! But the documentation of GetDiskSpace() is a bit odd... Why would you want to specify a directory if you get the space available on the drive ? You might as well specify the drive then... |
||||||||
|
|
|||||||
Here's a simple script to get disk space and size. Written this in 2 mins, a personal record Code:
|
||||||||
|
|
|||||||
URL found in 10 seconds :-) DiskSpace() - returns the available disk space on a drive |
||||||||
|
|
|||||||
The GAVEN principal |
||||||||
|
|
|||||||
LOL nice one |