| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
4c38808d92b95 added some logic to make a "to" path with no
directory component inherit from the current working directory
rather than the directory portion of the "from" path. It also
added a trailing dot to make null file types unambiguous. But
the comments emphasized the latter and made no mentin of the
former, and the implementation was unnecessarily complex.
|
|
|
|
|
|
|
|
|
|
| |
This backs out the changes introduced in fc06fdeb76c89. On
reflection, it doesn't make any sense to support what is actually
a Unix *report* mode in an API that does not report filenames.
File::Copy just needs to supply names to the underlying copy
functions that they can operate on. How those names are presented
is of no concern here as we don't present them to the caller.
|
|
|
|
|
|
| |
The variable name is '$^O' not '-$^O'. This meant File::Copy::move
didn't put the file in the current working directory when the to
argument had no path component.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since File::Compare's functions are documented to return 1, 0, or -1, we will
continue to examine the return value in our tests, rather than simply checking
for truth when 0 or 1 is returned.
Following code review, eliminate trailing whitespace.
For: RT #118823
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
This passes whether the tests are in lib/ (and hence run with the CWD as t/)
or in ext/File-Find (and hence run with that as the CWD) because they find
t/op/taint.t or ext/File-Find/t/taint.t respectively.
Change taint.t to count the number of times it finds a file named taint.t,
and fail if the count isn't 1. find.t was already testing a count.
|
|
|
|
|
|
|
|
|
| |
In find.t merge the two BEGIN blocks and eliminate the redundant
C<use File::Spec;>
In both, don't attempt to change directory to t/ (which will be unhelpful
once File::Find is moved to ext/)
Only make paths in @INC absolute if $ENV{PERL_CORE} is set (which will ease
making File::Find dual-life, if we want to this.)
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
cygwin appears to be unique in that it uses fast_abs_path() for
abs_path() and vaguely follows POSIX semantics on directory permissions.
Previously the tempdir created would be chmod() to 0600 (non-executable)
and fast_abs_path() would croak when it couldn't chdir into the
directory.
|
| |
|
|
|
|
| |
Bump $VERSION for File::Find.
|
| |
|
| |
|
|
|
|
| |
Setting 0100, 0300 and 0500 on files is totally non-reversable
|
| |
|
| |
|
|
|
|
|
|
|
| |
EPOC was a family of operating systems developed by Psion for mobile
devices. It was the predecessor of Symbian.
The port was last updated in April 2002.
|
|
|
|
|
| |
The extension of a VMS directory may be presented as .DIR or .dir
depending on various settings and its actual name on disk.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By defining NO_TAINT_SUPPORT, all the various checks that perl does for
tainting become no-ops. It's not an entirely complete change: it doesn't
attempt to remove the taint-related interpreter variables, but instead
virtually eliminates access to it.
Why, you ask? Because it appears to speed up perl's run-time
significantly by avoiding various "are we running under taint" checks
and the like.
This change is not in a state to go into blead yet. The actual way I
implemented it might raise some (valid) objections. Basically, I
replaced all uses of the global taint variables (but not PL_taint_warn!)
with an extra layer of get/set macros (TAINT_get/TAINTING_get).
Furthermore, the change is not complete:
- PL_taint_warn would likely deserve the same treatment.
- Obviously, tests fail. We have tests for -t/-T
- Right now, I added a Perl warn() on startup when -t/-T are detected
but the perl was not compiled support it. It might be argued that it
should be silently ignored! Needs some thinking.
- Code quality concerns - needs review.
- Configure support required.
- Needs thinking: How does this tie in with CPAN XS modules that use
PL_taint and friends? It's easy to backport the new macros via PPPort,
but that doesn't magically change all code out there. Might be
harmless, though, because whenever you're running under
NO_TAINT_SUPPORT, any check of PL_taint/etc is going to come up false.
Thus, the only CPAN code that SHOULD be adversely affected is code
that changes taint state.
|
|
|
|
|
| |
MPE/iX was a business-oriented minicomputer operating system made by
Hewlett-Packard. Support from HP terminated at the end of 2010.
|
|
|
|
|
| |
On VMS with default setttings, the filename is reported as copy.t,
not Copy.t, so make the regex allow that.
|
|
|
|
|
|
|
|
|
| |
Copying a file onto itself was made a fatal error by 96a91e0163.
This was changed in 754f2cd0b9 from an undesirable croak() to return 1,
but the documentation was never changed from it being a fatal error.
It should probably have remained an error as per the documentation (but
updated not to say fatal) for consistency with cases of copying a file
onto itself via symbolic links or hard links.
|
|
|
|
|
| |
Failure was introduced by 43ddfa5614 which looks for a warning message from
code that isn't run on Windows.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Back in a1ccf0c4149b we converted the current working directory to
Unix format on VMS, but neglected to change what later gets pasted
onto it with a hard-coded slash delimiter. The resulting mongrel
filespec was invalid and of course would not appear to exist even
if the file did exist under a properly assembled name.
So this commit makes the use of Unix-style paths on VMS within
_find_opt consistent.
The bug was tickled by a recent change to Module::Pluggable, whose
tests and the tests of other modules that depend on it started
failing en masse.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It seems that gcc produces this:
$ ./perl -Ilib -e 'warn $^X'
/Users/sprout/Perl/perl.git/perl at -e line 1.
while g++ produces this:
$ ./perl -Ilib -e 'warn $^X'
./perl at -e line 1.
(I may be misdiagnosing this, but I have two blead builds that give
different values for $^X.)
The script is using $^X for testing, which is why it could produce
different results.
In any case, this produces the same output for both compilers:
use File::stat;
my $stat = File::stat::stat('./perl');
warn eval '-l $stat';
warn eval '-l "./perl"';
__END__
Warning: something's wrong at - line 3.
1 at - line 4.
The test is wrong, as -l _ will fail after a stat. You have to do
lstat for -l _ to work. Similarly, -l $stat_obj should only return
true if the $stat_obj was returned by File::stat::lstat.
This commit adjusts the test accordingly.
|
|
|
|
|
|
| |
Testing this fails intermittently on darwin, which has POSIXly-correct atime
semantics. When tests run in parallel, the atime of $^X will update whenever
another perl process starts, which is a race condition with this test.
|
|
|
|
|
|
|
|
|
|
|
| |
Previously File::stat's overloaded -x and -X operators did not give
the correct results for directories or executable files when running as
root. They had been treating executable permissions for root just like for
any other user, performing group membership tests etc. for files not owned
by root. They now follow the correct Unix behaviour - for a directory they
are always true, and for a file if any of the three execute permission bits
are set then they report that root can execute the file. Perl's builtin
-x and -X operators, added in Perl 2, have always been correct.
|
|
|
|
|
| |
Also, add a test that the array produced by File::stat::stat is identical to
the list produced by the builtin.
|
| |
|
|
|
|
|
|
| |
For each mode bit set, and all bits clear, test each filetest operator with
and without a File::stat object. Previously the only test was for the mode
the file was created with.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use CORE::stat instead of stat, to be clear which is the builtin, and which
is the routine that File::stat is prepared to export. As it is now
unambiguous which is which, remove comments that annotated each use.
Use isa_ok() in place of ok() to test the return value of File::stat::stat.
Use is_deeply() in place of is() and arrays interpolated into strings.
Move the data driven loop that tests most of the -X operators into a
function test_X_ops(), and use this to test both the tempfile
(non-executable) and $^X (executable).
Put the first sanity test of File::stat::stat inside a block so that its
lexicals don't leak.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug ID 20011110.104 (RT #7896) was fixed by commit 2f173a711df6278f in Nov
2001, but the test that commit added never actually tested this.
The initial problem was that the new code, as written, used C<stat>,
intending that to call File::stat::stat(). However the refactoring of the
test script (all part of the same commit) from C<use File::stat;> to
C<use_ok( 'File::stat' );> (not in a BEGIN block) intentionally eliminated
the export of &File::stat::stat. This means that plain C<stat> is the
core builtin.
Fixing this as-is to File::stat::stat() won't help, as tests have
subsequently been added earlier in the script that trigger the autoloading
of Symbol by File::stat (commit 83716b1ec25b41f2 in Feb 2002). Moving the
tests earlier won't help now that the test uses File::Temp, as that uses
IO::Seekable which uses IO::Handle, which unconditionally loads Symbol.
The simplest solution seems to be to move the test to its own file.
|
|
|
|
|
|
|
|
|
|
|
| |
The previous code had got very gnarly trying to use a file from the
distribution for the test file, attempting to cope with
1) Other programs reading the file and hence the atime updating
2) The perl interpreter reading the file and hence the atime updating :-)
3) Building with -Dmksymlinks meaning that the file is a symlink
All these problems and work arounds simply *vanish* if we use a tempfile.
This will also enable us to change its mode in the future for better testing.
|
|
|
|
|
|
|
|
|
|
| |
The stat builtin is always implemented, so no need for an eval {} test to
check for this. The presence or absence of <sys/stat.h> at the C level isn't
going to affect the outcome of this test.
Both have been in the test script since it was added (as t/lib/filestat.t)
by commit f7a45afb043dafc5 in May 2001. I suspect that both were copied
from one of the Net::* test scripts which was being used as the template.
|
|
|
|
|
|
|
|
|
| |
Previously the use filetest "access" tests were separate, and didn't test
all the "should not warn" cases. By moving them into the main data-driven
loop it's trivial to test everything.
Also test that all the correct errors are seen on VMS, and not seen anywhere
else.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Also replace use_ok (not in BEGIN) with a simple require. If the require
fails it's not worth trying to test anything else, Test::More's END
handing will automatically report a test failure, so the failure will be
recorded.
Add an editor block.
|
|
|
|
|
|
| |
None of these have been changed in over a decade, aside from re-indentation.
Leave in 3 commented-out print statements which are necessary to understand
a FIXME comment.
|
|
|
|
| |
This avoids generating deprecation warnings.
|
|
|
|
|
|
|
| |
On VMS, there is an additional warning that causes the warning of
interest to be lost and the test to fail. So append each warning
as we see it and then we'll find the access warning we're testing
for as long as it's in there somewhere.
|