I am looking a small script which will tell me whether a file is an empty file or not , but i am unable to display this.
I have used the below code :
opendir DIR,$directory ;
while (my $dir =readdir DIR) {
if (-s "$dir") {
print "This is an empty file";
}
}
Here i am unable to print "This is an empty file" and my code does not went inside the if loop. Can anyone tell me what is the wrong in the above code