Bug #74283 [NEW]: Cannot write nor copy to file names ending with dot.

From: Date: Tue, 21 Mar 2017 12:24:59 +0000
Subject: Bug #74283 [NEW]: Cannot write nor copy to file names ending with dot.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207977@lists.php.net to get a copy of this message
From: pavel dot hlousek at gmail dot com Operating system: Windows PHP version: 7.1.3 Package: Filesystem function related Bug Type: Bug Bug description:Cannot write nor copy to file names ending with dot. Description: ------------ PHP5.6 handled the same way file names without extension written either "filename" or "filename." (with dot character at the end of the file name). PHP7.1.3 handles both forms of file name only in some of the functions but throws warning "Permission denied" in others. OK functions: file_get_contents, file_exists Bad functions: file_put_contents, copy, rename Test script: --------------- 1) file_put_contents('test.', 'test.'); 2) file_put_contents('test.txt', 'test.txt'); copy('test.txt', 'test.'); 3) file_put_contents('test.txt', 'test.txt'); rename('test.txt', 'test.'); Expected result: ---------------- 1) File "test" written to file system with "test." content. 2) File "test" exists in file system with "test.txt" content. 3) File "test" exists in file system with "test.txt" content. Actual result: -------------- 1-3) Warning: Permission denied. Files not created. -- Edit bug report at https://bugs.php.net/bug.php?id=74283&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74283&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74283&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74283&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=74283&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=74283&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=74283&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=74283&r=needscript Try newer version: https://bugs.php.net/fix.php?id=74283&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=74283&r=support Expected behavior: https://bugs.php.net/fix.php?id=74283&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=74283&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=74283&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=74283&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74283&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=74283&r=dst IIS Stability: https://bugs.php.net/fix.php?id=74283&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=74283&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=74283&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=74283&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=74283&r=mysqlcfg

« previous php.bugs (#207977) next »