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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
2 + 30 = ?
Subscribe to this entry?

 
 [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 11:01:31 2024 UTC