Question: Write a program in java langauge to calculate the total size ( in bytes, no text or commas, just the integer answer ) of all

Write a program in java langauge to calculate the total size (in bytes, no
text
or commas, just the integer answer) of all files in the current directory /
folder and all sub-folders. Your code must include a recursive function
written and called by the student. Follow the pseudo code exactly.
PSEUDOCODE
int main
long total =0
print dirspace("")
dirspace(targetDir)
long sum =0;
for every entry in targetDir
if entry is a file
sum += size of entry
if entry is a dir and !("." or "..");
sum += dirspace(entry)
return sum
 Write a program in java langauge to calculate the total size

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!