php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76335 "link(): Bad file descriptor" with non-ASCII path
Submitted: 2018-05-12 14:49 UTC Modified: -
From: gadelat at gmail dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 7.2.5 OS: Windows 7
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gadelat at gmail dot com
New email:
PHP Version: OS:

 

 [2018-05-12 14:49 UTC] gadelat at gmail dot com
Description:
------------
link() does not work if source/target path is non-ascii

Test script:
---------------
C:\
λ touch file

C:\
λ mkdir a && cd a

C:\a
λ php -r "link(__DIR__.'/../file', __DIR__.'/b');"

C:\a
λ cd ..

C:\
λ mv a á && cd á

C:\á
λ php -r "link(__DIR__.'/../file', __DIR__.'/b');"
PHP Warning:  link(): Bad file descriptor in Command line code on line 1
PHP Stack trace:
PHP   1. {main}() Command line code:0
PHP   2. link() Command line code:1



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-05-12 16:13 UTC] gadelat at gmail dot com
On another machine, this time with Windows 10, there is different output, but it still doesn't work:

C:\Users\Beáta\parallel-functions>php -r "var_dump(file_exists(__DIR__.'/LICENSE'));link(__DIR__.'/LICENSE', __DIR__.'/b');"
bool(true)
PHP Warning:  link(): No such file or directory in Command line code on line 1
 [2018-05-14 08:45 UTC] ab@php.net
Automatic comment on behalf of ab
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9b8d8cac04dc663770d3d75a5c7660bfd7eacbef
Log: Fixed bug #76335 "link(): Bad file descriptor" with non-ASCII path
 [2018-05-14 08:45 UTC] ab@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jan 25 04:01:29 2025 UTC