Bug #8432

Fix Symlink support for Windows OS

Added by Bastian Waidelich over 11 years ago. Updated about 11 years ago.

Must have
Start date:
Due date:
% Done:


Estimated time:
PHP Version:
Has patch:


With version 5.3 PHP supports symlinks on Windows >= Vista.
symlink($target, $link) works indeed on my Windows 7 machine. But is_link($link) returns FALSE.
That's why the unit test

fails on Windows.

A solution might be to use readlink() instead of is_link() as readlink() returns the same for $target and $link (the path to the target)..

Related issues

Related to TYPO3.Flow - Task #8056: Remove configuration option for mirrorModeClosedKarsten Dambekalns


Updated by Karsten Dambekalns over 11 years ago

  • Status changed from New to Needs Feedback
  • Assignee set to Karsten Dambekalns

From the PHP manual about readlink():
This will trigger a warning and return false if you pass it a non-symlink.

This is something we don't want, no warnings please. So we'd have to check for the OS as well.

Given that what we see is a bug in PHP...
wait until they fix it?


Updated by Bastian Waidelich over 11 years ago

  • Status changed from Needs Feedback to Accepted
  • Assignee changed from Karsten Dambekalns to Bastian Waidelich

After a short chat with Karsten, we found out:
readlink() does not trigger a warning on Windows as long as you pass it a path to an existing file/folder or symlink.
Because the symlink integration is implemented very deep in the Windows filesystem, I doubt that PHP will be able to fix this issue soon. So we decided to add a new utility helper function F3\FLOW3\Utility\Files::is_link() that uses the readlink() workaround on Windows.


Updated by Bastian Waidelich over 11 years ago

  • Status changed from Accepted to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4862.


Updated by Karsten Dambekalns over 11 years ago

  • Target version set to 1.0 alpha 11

Also available in: Atom PDF