You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using dir()->ls() to create an array of nodes which I then stat, unfortunately stat() does not work as expected on symlinks: it returns the size of the symlink file (and not the target), and does not hint it is a symlink.
Neither does the nodelist ls() generates hint any of the files are symlinks: when I echo the class they are all File class.
multiple different solutions exist:
-ls() returns different nodes for files and links
-the file node has an isLink method, returning true or false
-hide the fact that the file is a symlink completely and return properties of target
-return an islink value (with target) when doing stat()
The text was updated successfully, but these errors were encountered:
stat calls lstat internally, which does not resolve symlink. That's working as intended as we should be able to stat symlinks and not only files.
The problem with ls not returning Links sounds like a bug to me. Which adapter do you use? Eio or child process (just var_dump the adapter if you use Filesystem::create())?
The problem with ls not returning Links sounds like a bug to me. Which adapter do you use? Eio or child process (just var_dump the adapter if you use Filesystem::create())?
Indeed, a symlink should show up as a Link not a File. What OS/PHP version/adapter/and extensions are you on @gizahNL ?
I'm using dir()->ls() to create an array of nodes which I then stat, unfortunately stat() does not work as expected on symlinks: it returns the size of the symlink file (and not the target), and does not hint it is a symlink.
Neither does the nodelist ls() generates hint any of the files are symlinks: when I echo the class they are all File class.
multiple different solutions exist:
-ls() returns different nodes for files and links
-the file node has an isLink method, returning true or false
-hide the fact that the file is a symlink completely and return properties of target
-return an islink value (with target) when doing stat()
The text was updated successfully, but these errors were encountered: