summaryrefslogtreecommitdiff
path: root/lib/File
Commit message (Collapse)AuthorAgeFilesLines
* use more descriptive examples in File::CopyZsbán Ambrus2013-06-091-3/+3
|
* typo fix for File::FindDavid Steinbrunner2013-05-251-2/+2
| | | | Bump $VERSION for File::Find.
* Bump File::Copy version as the contents have changedChris 'BinGOs' Williams2013-03-051-1/+1
|
* fix pod: add missing 'C' of inline code tagsreneeb2013-03-041-2/+2
|
* Skip tests in File::Copy tests on DragonflyBSD tooChris 'BinGOs' Williams2013-03-011-0/+3
| | | | Setting 0100, 0300 and 0500 on files is totally non-reversable
* Move File::DosGlob from lib to extFather Chrysostomos2012-12-092-429/+0
|
* Fix test-skipping logic for File::Find under no-taint-perlSteffen Mueller2012-11-201-2/+2
|
* Remove the EPOC port.Nicholas Clark2012-11-191-3/+2
| | | | | | | 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.
* Remove an inadvertent case sensitivity from find.t.Craig A. Berry2012-11-111-1/+1
| | | | | The extension of a VMS directory may be presented as .DIR or .dir depending on various settings and its actual name on disk.
* Add C define to remove taint support from perlSteffen Mueller2012-11-052-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Remove the MPE/iX port.Nicholas Clark2012-09-211-9/+1
| | | | | MPE/iX was a business-oriented minicomputer operating system made by Hewlett-Packard. Support from HP terminated at the end of 2010.
* Make new File::Copy test case insensitive.Craig A. Berry2012-08-311-1/+1
| | | | | On VMS with default setttings, the filename is reported as copy.t, not Copy.t, so make the regex allow that.
* Revert File::Copy::copy() to fail when copying a file onto itselfSteve Hay2012-08-282-6/+4
| | | | | | | | | 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.
* Fix File::Copy test failure on WindowsSteve Hay2012-08-281-0/+4
| | | | | Failure was introduced by 43ddfa5614 which looks for a warning message from code that isn't run on Windows.
* rt #111126 - don't empty a file with copy("foo/bar", "foo/");Tony Cook2012-08-242-6/+5
|
* rt #111126 - TODO test for copy foo/file to foo/Tony Cook2012-08-241-1/+27
|
* Consistent unixy path handling in File::Find::_find_opt.Craig A. Berry2012-08-201-1/+2
| | | | | | | | | | | | | | | 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.
* [perl #113796] lib/File/stat.t failures when -l $^XFather Chrysostomos2012-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* lib/File/stat.t shouldn't test -A $^XNicholas Clark2012-06-211-2/+7
| | | | | | 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.
* Fix File::stat's -x and -X for root for directories and executable files.Nicholas Clark2012-06-211-6/+13
| | | | | | | | | | | 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.
* Test that File::stat exports stat by default, overriding the builtin.Nicholas Clark2012-06-211-1/+7
| | | | | Also, add a test that the array produced by File::stat::stat is identical to the list produced by the builtin.
* lib/File/stat.t should also test the -X operators on directories.Nicholas Clark2012-06-211-6/+9
|
* In lib/File/stat.t, permute the test file's mode for more thorough testing.Nicholas Clark2012-06-211-0/+11
| | | | | | 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.
* Refactor lib/File/stat.t for robustness.Nicholas Clark2012-06-211-76/+87
| | | | | | | | | | | | | | | | 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.
* *Actually* test that bug 20011110.104 is fixed.Nicholas Clark2012-06-212-4/+28
| | | | | | | | | | | | | | | | | | | | 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.
* Simplify lib/File/stat.t by using a tempfile as the test victim.Nicholas Clark2012-06-211-28/+3
| | | | | | | | | | | 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.
* Remove needless skip tests from lib/File/stat.tNicholas Clark2012-06-211-8/+0
| | | | | | | | | | 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.
* In lib/File/stat.t, test everything with and without use filetest "access".Nicholas Clark2012-06-211-30/+39
| | | | | | | | | 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.
* Bring the joy of strict (and warnings) to lib/File/stat.tNicholas Clark2012-06-211-2/+5
|
* Replace repetitive code in lib/File/stat.t with a data driven loop.Nicholas Clark2012-06-211-28/+22
|
* Convert lib/File/stat.t from a complex plan calculation to done_testing().Nicholas Clark2012-06-211-5/+11
| | | | | | | | | 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.
* Remove commented-out debugging print statements from File:DosGlobNicholas Clark2012-06-031-6/+0
| | | | | | 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.
* Refactor File::DosGlob to avoid an unescaped { in a regex.Nicholas Clark2012-06-031-4/+2
| | | | This avoids generating deprecation warnings.
* Accumulate access warnings in stat.t.Craig A. Berry2012-05-251-1/+1
| | | | | | | 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.
* [perl #111638] fix -p on File::stat objectsTony Cook2012-05-212-2/+5
|
* [perl #111638] TODO for -p on a File::stat objectTony Cook2012-05-211-1/+15
|
* [rt #111640] warn on the right -X operators used on a File::stat objectTony Cook2012-05-212-4/+2
|
* [rt #111640] TODO tests for warnings from -X on File::statTony Cook2012-05-211-1/+25
|
* DosGlob.pm: Fix pod syntaxFather Chrysostomos2012-05-211-1/+1
|
* Remove obsolete comment from DosGlob.pmFather Chrysostomos2012-05-211-3/+0
| | | | | | | | | | | This comment was added by commit 37248846, without explanation. DosGlob.pm already had ‘use strict’ three days before that, added in commit b75c8c73, three days earlier. I can only assume that 37248846 was written before b75c8c73 was applied, and that simply adding ‘use strict’ didn’t work, considering that b75c8c73 changed quite a few things to make things strict-safe.
* Increase $File::DosGlob::VERSION to 1.07Father Chrysostomos2012-05-211-1/+1
|
* File::Find: typoFather Chrysostomos2012-05-211-1/+1
|
* Individual files may appear in list of directories to be searched.jkeenan2012-05-211-0/+8
| | | | | | Document that, then demonstrate that with additional tests. For RT #59750.
* Individual files may appear in list of directories to be searched.jkeenan2012-05-211-1/+51
| | | | | | Document that, then demonstrate that with additional tests. For RT #59750.
* Increase $File::Find::VERSION to 1.21Father Chrysostomos2012-05-211-1/+1
|
* Increase $File::Copy::VERSION to 2.23Father Chrysostomos2012-01-311-1/+1
| | | | | not 2.22, as that was used by 5.13.10, but the only changes in 5.13.10 were reverted for 5.13.11+.
* [perl #109104] File::Copy: Turn off ‘newline’ warningsFather Chrysostomos2012-01-311-1/+1
| | | | | | | | | These warnings exist to catch file operations on unchomped file names. But File::Copy should not be triggering them, otherwise it produces warnings for every copy("foo/bar\n", "baz/bar\n"), with no (easy) way to suppress the warning, as warnings are lexical. I don’t know how to test this portably.
* Version bumpsif-0.0602Father Chrysostomos2011-11-221-1/+1
|
* [RT #36079] Convert ` to '.jkeenan2011-11-221-1/+1
|
* Update several test cases to not generate failures on VOS.Paul Green2011-11-182-0/+3
|