Skip to content
Snippets Groups Projects
Commit 6c2b614a authored by Mike McQuaid's avatar Mike McQuaid
Browse files

pathname: make compute_disk_usage handle symlinks.

parent a68d3874
No related branches found
No related tags found
No related merge requests found
......@@ -26,11 +26,17 @@ module DiskUsageExtension
private
def compute_disk_usage
if directory?
path = if symlink?
resolved_path
else
self
end
if path.directory?
scanned_files = Set.new
@file_count = 0
@disk_usage = 0
find do |f|
path.find do |f|
if f.directory?
@disk_usage += f.lstat.size
else
......@@ -47,7 +53,7 @@ module DiskUsageExtension
end
else
@file_count = 1
@disk_usage = lstat.size
@disk_usage = path.lstat.size
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment