php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54122 symlink should create backslashs
Submitted: 2011-02-28 18:01 UTC Modified: -
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: carsten_sttgt at gmx dot de Assigned:
Status: Open Package: Filesystem function related
PHP Version: Irrelevant OS: Windows
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: carsten_sttgt at gmx dot de
New email:
PHP Version: OS:

 

 [2011-02-28 18:01 UTC] carsten_sttgt at gmx dot de
Description:
------------
Most people are using forward slashs, even on Windows. But there is a problem with symlink().

As you can see in the example, the symlink is created as given in the code. Of course, many programs can't work with slashs, e.g. cmd.exe internal functions. The symlink data it read by programs "as is", in this case "./foo.php". And a "/" is not working in cmd.exe (or other programs).

Thus it would be nice, if symlink() on Windows is changing "/" itself to "\".



Test script:
---------------
In the shell:
php -r "symlink('./foo.php', 'bar.php');"
dir bar.php
type bar.php


Expected result:
----------------
28.02.2011  17:49    <SYMLINK>      bar.php [.\test.php]
Content of test.php

Actual result:
--------------
28.02.2011  17:49    <SYMLINK>      bar.php [./test.php]
File not found.


Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 14:01:28 2024 UTC