Bug #75679 [Opn->Csd]: Path 260 character problem

From: Date: Thu, 14 Dec 2017 15:18:56 +0000
Subject: Bug #75679 [Opn->Csd]: Path 260 character problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213100@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75679&edit=1 ID: 75679 Updated by: ab@php.net Reported by: r dot wagler at gmx dot net Summary: Path 260 character problem -Status: Open +Status: Closed Type: Bug Package: Filesystem function related Operating System: Windows 8.1 Pro PHP Version: 7.2.0 Block user comment: N Private report: N New Comment: Automatic comment on behalf of ab Revision: http://git.php.net/?p=php-src.git;a=commit;h=4c0af1fbd41761524682f59c96f2c49e0257298c Log: Fixed bug #75679 Path 260 character problem Previous Comments: ------------------------------------------------------------------------ [2017-12-13 23:34:35] r dot wagler at gmx dot net Description: ------------ Function copy () can not handle files with pathes of strlen () == 260 characters. Pathes with less or more then 260 characters are *not* affected. --- > The version number of the PHP package or files you are using. http://windows.php.net/downloads/releases/php-7.2.0-nts-Win32-VC15-x64.zip > Any changes made in your php.ini compared to php.ini-dist or php.ini-recommended (not your > whole php.ini!) I made a clean copy of php.ini-production (copy php.ini-production php.ini). Test script: --------------- <?PHP $Files2Report = [ str_pad ('C:/TEMP/' . str_repeat (str_pad ('path_259_characters_long_' . microtime (true), 100, '_') . '/', 2), 259, '_') => [], str_pad ('C:/TEMP/' . str_repeat (str_pad ('path_260_characters_long_' . microtime (true), 100, '_') . '/', 2), 260, '_') => [], str_pad ('C:/TEMP/' . str_repeat (str_pad ('path_261_characters_long_' . microtime (true), 100, '_') . '/', 2), 261, '_') => [], ]; foreach ($Files2Report as $file => &$Report) { $Report = ['strlen' => strlen ($file), 'result' => 'nok']; if (! is_dir (dirname ($file))) mkdir (dirname ($file), 0777, true); if (@copy (__FILE__, $file) && is_file ($file)) { $Report['result'] = 'ok'; } print_r ($Report); } //print_r ([$Files2Report, phpversion ()]); ?> Expected result: ---------------- Array ( [strlen] => 259 [result] => ok ) Array ( [strlen] => 260 [result] => ok ) Array ( [strlen] => 261 [result] => ok ) Actual result: -------------- Array ( [strlen] => 259 [result] => ok ) PHP Warning: copy(C:/TEMP/path_260_characters_long_1513207625.2858____________________________________________________________/path_260_characters_long_1513207625.2858____________________________________________________________/__________________________________________________): failed to open stream: No such file or directory in ...\path_260_character_problem.php on line 13 Array ( [strlen] => 260 [result] => nok ) Array ( [strlen] => 261 [result] => ok ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75679&edit=1

« previous php.bugs (#213100) next »