develooper Front page | perl.perl5.porters | Postings from September 2005

Pls Review: File::System::Spec

Thread Next
John E. Malmberg
September 29, 2005 21:56
Pls Review: File::System::Spec
Message ID:
Michael G Schwern wrote:
 > Put the logic in a module.  Put the module on CPAN.
 > And this part is really my fault.  I've been meaning to write
 > File::System::Spec and Operating::System::Spec for a long time
 > now to allow easy answers to just these sorts of questions.

Would this fit the bill?  It is a File::System::Spec.

It gives 0 or 1 answers for UNIX and VMS and undef for other platforms 
until those can be added.

The code is vms.c will override these methods when it supports giving 
different answers.  In the mean time these methods will provide the 
expected results for VMS and I think for UNIX on older Perls.

It exposes the following methods that can optionally accept an argument 
to change the existing value.

In all cases, a return of undef indicates an exact answer is not known. 
  Usually that will be interpreted as a fallback to UNIX behavior.

                  0 = File specifications are returned in the default
                      behavior for the platform
                  1 = File specifications are return in UNIX format.

                  0 = File specifications are assumed to be in the
                      the default behavior for the platform.
                  1 = File specifications are assumed to be in UNIX

                  0 = Full character set is available for pathnames.
                  1 = A restricted character set is available for

                  0 = The case of filenames is not preserved.
                  1 = The case of filenames is preserved.

                  0 = File lookups require exact case.  Implies
                  1 = File lookups are case tolerant.

                  0 = File names are not forced to lower case.
                  1 = File names are forced to lower case.

                  0 = No locking
                  1 = Files are locked by default on open.

Until the information for the other Perl platforms is added though, I do 
not see how it can get rid of the test for the platform name where these 
tests are done.

Personal Opinion Only

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About