php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #32355 Directory-access with dirname
Submitted: 2005-03-17 19:18 UTC Modified: 2005-03-26 01:00 UTC
From: eisbrenner at gid-gmbh dot de Assigned:
Status: No Feedback Package: Feature/Change Request
PHP Version: 4.3.10 OS: Windows / All Webserver
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: eisbrenner at gid-gmbh dot de
New email:
PHP Version: OS:

 

 [2005-03-17 19:18 UTC] eisbrenner at gid-gmbh dot de
Description:
------------
If, the copy-function is called
with
copy (dirname(__FILE__) . '/anyname', '/path/to/new/place');
on windows-systems thtis will result in i.e.
copy (c:\temp\my_subdir/anyname ....
this is not handled correctly, so the file won't be copied.
it's not just related to 4.3.10, 4.3.x, 4.2.x, maybe elder versions.
for solutions, that should work independet to the OS installed it's necassary to use 
copy (str_replace("\\", "/", dirname(__FILE__)) . '/anyname', '/path/to/new/place');
instead.
it would be nice not to need this.
or is there an undocumented parameter for windows to get slash instead of the BS ?

same behaviour with move_uploaded_file, move.
include works fine without str_replace.

Reproduce code:
---------------
see description


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-17 19:27 UTC] tony2001@php.net
Why don't you just use DIRECTORY_SEPARATOR constant ?
 [2005-03-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 16 05:01:35 2024 UTC