Answer:
import os, sys, stat
from stat import *
command = 'find ' + sys.argv[1] + ' -name *' + sys.argv[2] + '*'
print(command)
totalFiles = os.popen(command).read()
totalFiles = totalFiles.split()
totalSize = 0
for line in totalFiles:
statinfo = os.stat(line)
if stat.S_ISREG(statinfo.st_mode):
print(line, statinfo.st_size, 'bytes')
totalSize += statinfo.st_size
else:
print(line, '...')
print('Total file size:', totalSize, 'bytes')
Explanation:
- According to command line arguments, build the find command.
- Store the product by executing the command.
- Loop through all files in the output list using the for loop.
- Display the file name and size, If the file is regular otherwise just display the file name.
Phones produce radiation which could damage your brain
Answer:
Procedural, Visual, Logic - Based
Explanation:
Answer: Transaction is the process of processing information in a standalone system or distributed system. There are two basic types of systems which are preemptive and non preemptive transactions.
Explanation:
Transaction can be complete successfully or it can fail but it can never be partially completed. Computer processes which completes in its entirety or does not complete at all are termed as processes.
Preemptive processes are those where the cpu is allotted to a process for a definite time . The cpu can be given to another process if it has higher priority.
Whereas in non preemptive processes the cpu once allotted to a process cannot be assigned to another process until job is finished for the first process.
Answer:
Solids
Explanation:
The speed of sound is usually fastest in solids, where molecules are closest together, and slowest in gases, where molecules are farthest apart.