Guest User

Untitled

a guest
Nov 24th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. Select[FileNames["*", dir, Infinity],
  2. Not@*DirectoryQ] // Map[FileByteCount] // Total
  3.  
  4. Select[FileNames["*", "~/Documents", Infinity], Not@*DirectoryQ] //
  5. Replace[
  6. Quiet@Map[FileByteCount, #],
  7. Except[_Integer] -> 0,
  8. 1
  9. ] & // Total // AbsoluteTiming
  10.  
  11. {2.38783, 6161484250}
  12.  
  13. ToExpression@
  14. StringSplit[
  15. RunProcess[{"du", "-s", ExpandFileName@#},
  16. "StandardOutput"]][[1]]*1024/2 &@
  17. "~/Documents" // AbsoluteTiming
  18.  
  19. {0.352957, 6080770048}
Add Comment
Please, Sign In to add comment