Robert Klemme
8/10/2007 8:20:00 AM
2007/8/9, Jon Hawkins <globyy3000@hotmail.com>:
> how would i go about surfing a whole directory instead of using a
> Dir.glob(*/**)
> Basically how would i do it using the Find method. I need to surf the
> entire file system and pull up my total number of files that arnt an
> actual directory.
non_directory_count = Integer `find / -not -type d | wc -l`
Of course, the command in backticks also works on a shell prompt - if
you just need that count. (btw, I used Integer to detect situations
where the command does not work and return an improper result (i.e. an
empty string).
Kind regards
robert