Skip to content

Commit 1e880ca

Browse files
committed
Reword
1 parent 3c9a671 commit 1e880ca

File tree

1 file changed

+23
-3
lines changed

1 file changed

+23
-3
lines changed

components/finder.rst

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,29 @@ If you want to follow `symbolic links`_, use the ``followLinks()`` method::
127127

128128
$finder->files()->followLinks();
129129

130-
.. note::
131-
132-
Be careful, the ``followLinks`` method does not resolve links. This method makes the links to directories followed/traversed into. If we suppose a folder *followLinksFolder* which contains a folder with a file and a symlink of the folder *folder, file.txt and symlinkfolder*, thanks to the Finder component ``$finder->in('/home/user/followLinksFolder');`` will retrieve three elements *folder, folder/file.txt and symlinkfolder*. If, we use the ``followLinks`` method instead ``$finder->followLinks()->in('/home/user/followLinksFolder');``, we will retrieve also a fourth element *folder, folder/file.txt, symlinkfolder and symlinkfolder/file.txt*.
130+
Note that this method follows links but it doesn't resolve them. Consider
131+
the following structure of files of directories:
132+
133+
.. code-block:: text
134+
135+
├── folder1/
136+
│ ├──file1.txt
137+
│ ├── file2link (symbolic link to folder2/file2.txt file)
138+
│ └── folder3link (symbolic link to folder3/ directory)
139+
├── folder2/
140+
│ └── file2.txt
141+
└── folder3/
142+
└── file3.txt
143+
144+
If you try to find all files in ``folder1/`` via ``$finder->files()->in('/path/to/folder1/')``
145+
you'll get the following results:
146+
147+
* When **not** using the ``followLinks()`` method: ``file1.txt`` and ``file2link``
148+
(this link is not resolved). The ``folder3link`` doesn't appear in the results
149+
because it's not followed or resolved;
150+
* When using the ``followLinks()`` method: ``file1.txt``, ``file2link`` (this link
151+
is still not resolved) and ``folder3/file3.txt`` (this file appears in the results
152+
because the ``folder1/folder3link`` link was followed).
133153

134154
Version Control Files
135155
~~~~~~~~~~~~~~~~~~~~~

0 commit comments

Comments
 (0)