Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -0,0 +1,64 @@
|
|||
#include "file.bi"
|
||||
|
||||
Dim As String directory = Curdir()
|
||||
If Command(1) <> "" Then directory = Command(1)
|
||||
|
||||
Dim As String filename
|
||||
Dim As Longint fileSize
|
||||
Dim As Integer fileCnt(7) = {0, 0, 0, 0, 0, 0, 0, 0}
|
||||
Dim As String categories(7) = {" < 1KB ", " 1KB - 10KB ", " 10KB - 100KB", "100KB - 1MB ", " 1MB - 10MB ", " 10MB - 100MB", "100MB - 1GB ", " > 1GB "}
|
||||
|
||||
If Right(directory, 1) <> "/" And Right(directory, 1) <> "\" Then directory &= "\"
|
||||
|
||||
filename = Dir(directory + "*.*")
|
||||
|
||||
Do While Len(filename) > 0
|
||||
fileSize = Filelen(directory + filename)
|
||||
|
||||
Select Case fileSize
|
||||
Case Is < 1000
|
||||
fileCnt(0) += 1
|
||||
Case 1000 To 9999
|
||||
fileCnt(1) += 1
|
||||
Case 10000 To 99999
|
||||
fileCnt(2) += 1
|
||||
Case 100000 To 999999
|
||||
fileCnt(3) += 1
|
||||
Case 1000000 To 9999999
|
||||
fileCnt(4) += 1
|
||||
Case 10000000 To 99999999
|
||||
fileCnt(5) += 1
|
||||
Case 100000000 To 999999999
|
||||
fileCnt(6) += 1
|
||||
Case Else
|
||||
fileCnt(7) += 1
|
||||
End Select
|
||||
|
||||
filename = Dir()
|
||||
Loop
|
||||
|
||||
Print "File size distribution for: '"; directory; !"'\n"
|
||||
|
||||
Dim As Integer i, barWidth
|
||||
Dim As Integer maxCnt = 0, total = 0
|
||||
|
||||
For i = 0 To 7
|
||||
If fileCnt(i) > maxCnt Then maxCnt = fileCnt(i)
|
||||
Next i
|
||||
|
||||
Const As Integer maxBarWidth = 50
|
||||
|
||||
For i = 0 To 7
|
||||
barWidth = (fileCnt(i) * maxBarWidth) \ maxCnt
|
||||
If fileCnt(i) > 0 And barWidth = 0 Then barWidth = 1
|
||||
|
||||
Print categories(i); ": ";
|
||||
Print String(barWidth, Chr(178)); " "; fileCnt(i)
|
||||
Next i
|
||||
|
||||
For i = 0 To 7
|
||||
total += fileCnt(i)
|
||||
Next
|
||||
Print !"\nTotal number of files: "; total
|
||||
|
||||
Sleep
|
||||
Loading…
Add table
Add a link
Reference in a new issue