php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #28279 function symlink() crash under windows
Submitted: 2004-05-05 05:30 UTC Modified: 2004-05-05 11:17 UTC
From: motion4u at hotmail dot com Assigned:
Status: Suspended Package: Feature/Change Request
PHP Version: 4.3.6 OS: Windows 2000 Advanced
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2004-05-05 05:30 UTC] motion4u at hotmail dot com
Description:
------------
Create and Manipulate NTFS Junction Points doesn't work in PHP but it was solved by www.sysinternals.com. They also offer the c-code free for download.

I have tested it and it works very well.

You can download the free source code there:

http://www.sysinternals.com/files/jnctnsrc.zip



Reproduce code:
---------------
$letters = 'abcdefghijklmnopqrstuvwxyz'; 
srand((double) microtime() * 1000000); 
$string = ''; 
for ($i = 1; $i <= rand(4,12); $i++) { 
   $q = rand(1,24); 
   $string = $string . $letters[$q]; 
} 
//----- this part can't work under windows
$handle = opendir($downloaddir); 
while ($dir = readdir($handle)) { 
   if (is_dir($downloaddir . $dir)){ 
     if ($dir != "." && $dir != ".."){ 
         @unlink($downloaddir . $dir . "/" . $filename); 
         @rmdir($downloaddir . $dir); 
     } } } 
closedir($handle); //------
mkdir($downloaddir . $string, 0777); 
// here symlink produce browser crash under windows
symlink($safedir . $filename, $downloaddir . $string . "/" . $filename); 
Header("Location: ".$downloadURL.$string. "/" . $filename);

Expected result:
----------------
start downloading but produce browser crash


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-05 11:17 UTC] wez@php.net
Windows versions of PHP don't even have symlink(), readlink(), linkinfo() or link(), so it can't possibly be crashing.

I'll accept your feature request for NTFS junctions, but can't do anything about it until we are developing PHP 5.1.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC