Re: count files + dirs CORRECTED

From: Joe Smith (Joe.Smith_at_inwap.com)
Date: 04/04/04


Date: Sun, 04 Apr 2004 08:55:33 GMT

GreenLight wrote:

> my $full_name = $dir . $file_name;
> if (-f $full_name) {
> $file_count++;
> } elsif (-d $full_name) {
> $dir_count++;
> }

For DOS, I would use:

        if (-d $full_name) {
                $dir_count++;
        } else {
                $file_count++;
        }

For Unix, I would use:

        if (-f $full_name) {
                $file_count++;
        } elsif (-d $full_name) {
                $dir_count++;
        } else {
                $special_count++;
        }

The poing being that there are more than just files and directories
in some operating systems.
        -Joe



Relevant Pages

  • Re: How About..............
    ... there were lots of OSes around not just unix and dos. ... > Back in the old days when Unix and Dos were the only operating systems, ... >> How about an OS programmed in JAVA. ...
    (comp.lang.java.programmer)
  • Re: MicroMonopoly aids Terrorism?
    ... >Microsoft OS and probably won't even touch DOS. ... whether they are currently selling Win2000. ... That's far fewer than 20 operating systems. ... DOS is in some ways a pale imitation of Unix. ...
    (microsoft.public.windowsxp.general)
  • Re: MicroMonopoly aids Terrorism?
    ... >Microsoft OS and probably won't even touch DOS. ... whether they are currently selling Win2000. ... That's far fewer than 20 operating systems. ... DOS is in some ways a pale imitation of Unix. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: MicroMonopoly aids Terrorism?
    ... >Microsoft OS and probably won't even touch DOS. ... whether they are currently selling Win2000. ... That's far fewer than 20 operating systems. ... DOS is in some ways a pale imitation of Unix. ...
    (microsoft.public.windowsxp.newusers)
  • Re: MicroMonopoly aids Terrorism?
    ... >Microsoft OS and probably won't even touch DOS. ... whether they are currently selling Win2000. ... That's far fewer than 20 operating systems. ... DOS is in some ways a pale imitation of Unix. ...
    (microsoft.public.security)