B
bill
I'm writing a package that needs to interact with cvs. For what
I want to do I need the ability to determine whether or not a file
is considered "regular" by cvs. According to the cvs docs:
Special Files
In normal circumstances, CVS works only with regular files.
Every file in a project is assumed to be persistent; it must be
possible to open, read and close them; and so on...
Therefore, I have
sub is_regular {
local $_ = shift; # argument is a filename
# brute-force elimination
!(-b||-c||-d||-l||-p||-S||-t);
}
(Note: having is_regular return -f --instead of the above--would
be no good; for example -f evaluates to 1 if $_ is the name of a
symlink.)
Is there an easier way (at least easier on the eyes) to test for
"regularity" than the brute-force elimination expression above?
Thanks a bunch,
-bill
I want to do I need the ability to determine whether or not a file
is considered "regular" by cvs. According to the cvs docs:
Special Files
In normal circumstances, CVS works only with regular files.
Every file in a project is assumed to be persistent; it must be
possible to open, read and close them; and so on...
Therefore, I have
sub is_regular {
local $_ = shift; # argument is a filename
# brute-force elimination
!(-b||-c||-d||-l||-p||-S||-t);
}
(Note: having is_regular return -f --instead of the above--would
be no good; for example -f evaluates to 1 if $_ is the name of a
symlink.)
Is there an easier way (at least easier on the eyes) to test for
"regularity" than the brute-force elimination expression above?
Thanks a bunch,
-bill