| 1 |
ninoborges |
8 |
# this program will count all of the files in a particular directory.
|
| 2 |
|
|
# EBORGES
|
| 3 |
|
|
# 11.07.01
|
| 4 |
|
|
|
| 5 |
|
|
import sys,os
|
| 6 |
|
|
from lgflcntr import getoffice
|
| 7 |
|
|
|
| 8 |
|
|
appservers = getoffice()
|
| 9 |
|
|
|
| 10 |
|
|
def main():
|
| 11 |
|
|
total = 0
|
| 12 |
|
|
print "Office/Floor \t | Number of people with LBS"
|
| 13 |
|
|
print "-----------------------------------------------"
|
| 14 |
|
|
for x in appservers:
|
| 15 |
|
|
directory = "/app/log_files/SMS_Problems"
|
| 16 |
|
|
#directory = "/app/Lbstrans_users"
|
| 17 |
|
|
place = "//" + x + directory
|
| 18 |
|
|
try:
|
| 19 |
|
|
amount = len(os.listdir(place))
|
| 20 |
|
|
except WindowsError:
|
| 21 |
|
|
amount = 0
|
| 22 |
|
|
total = total + amount
|
| 23 |
|
|
print x, "\t \t | \t", amount
|
| 24 |
|
|
print '-----------------------------------------------'
|
| 25 |
|
|
print '\nTotal\t\t | \t', total
|
| 26 |
|
|
print '\n done!'
|
| 27 |
|
|
|
| 28 |
|
|
if __name__ == '__main__':
|
| 29 |
|
|
main()
|