Rev 7 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 7 | Rev 37 | ||
|---|---|---|---|
| Line 17... | Line 17... | ||
| 17 | 17 | ||
| 18 | # ============================================================================= | 
            18 | # ============================================================================= | 
          
| 19 | # Functions | 
            19 | # Functions | 
          
| 20 | # ============================================================================= | 
            20 | # ============================================================================= | 
          
| 21 | 21 | ||
| 22 | function Usage($mesg, $progname)  | 
            22 | function Usage($progname ,$mesg)  | 
          
| 23 | { | 
            23 | { | 
          
| 24 | echo "Usage : $progname\n";  | 
            24 | echo "Usage: $progname directory\n";  | 
          
| 25 | echo "$mesg\n";  | 
            25 | echo "$mesg\n";  | 
          
| 26 | } | 
            26 | } | 
          
| 27 | 27 | ||
| 28 | function traverse($dir)  | 
            28 | function traverse($dir)  | 
          
| 29 | { | 
            29 | { | 
          
| Line 71... | Line 71... | ||
| 71 | { | 
            71 | { | 
          
| 72 | $directory = $argv[1];  | 
            72 | $directory = $argv[1];  | 
          
| 73 | if (is_dir($directory))  | 
            73 | if (is_dir($directory))  | 
          
| 74 | start_traverse($directory);  | 
            74 | start_traverse($directory);  | 
          
| 75 |         else | 
            75 |         else | 
          
| 76 | Usage($progname, "ERROR: No directory $directory found");  | 
            76 | Usage($progname, "ERROR: Not a directory : $directory");  | 
          
| 77 | } | 
            77 | } | 
          
| 78 | else | 
            78 | else | 
          
| 79 | Usage($progname, "ERROR: 1 argument expected");  | 
            79 | Usage($progname, "ERROR: 1 argument expected");  | 
          
| 80 | 80 | ||
| 81 | ?> | 
            81 | ?> |