4
4
The Filesystem Component
5
5
========================
6
6
7
- The Filesystem component provides basic utilities for the filesystem and
8
- paths manipulation.
7
+ The Filesystem component provides platform-independent utilities for
8
+ filesystem operations and for file/directory paths manipulation.
9
9
10
10
Installation
11
11
------------
@@ -19,12 +19,8 @@ Installation
19
19
Usage
20
20
-----
21
21
22
- The component contains two classes:
23
-
24
- - The :class: `Symfony\\ Component\\ Filesystem\\ Filesystem ` which provides utilities
25
- for filesystem write operations.
26
- - The :class: `Symfony\\ Component\\ Filesystem\\ Path ` which provides utilities
27
- for paths manipulation.::
22
+ The component contains two main classes called :class: `Symfony\\ Component\\ Filesystem\\ Filesystem `
23
+ and :class: `Symfony\\ Component\\ Filesystem\\ Path `::
28
24
29
25
use Symfony\Component\Filesystem\Exception\IOExceptionInterface;
30
26
use Symfony\Component\Filesystem\Filesystem;
@@ -40,8 +36,8 @@ The component contains two classes:
40
36
echo "An error occurred while creating your directory at ".$exception->getPath();
41
37
}
42
38
43
- Filesystem
44
- ----------
39
+ Filesystem Utilities
40
+ --------------------
45
41
46
42
``mkdir ``
47
43
~~~~~~~~~
@@ -325,22 +321,21 @@ creates them before appending the contents.
325
321
326
322
The third argument of ``appendToFile() `` was introduced in Symfony 5.4.
327
323
328
- Path
329
- ----
324
+ Path Manipulation Utilities
325
+ ---------------------------
330
326
331
327
.. versionadded :: 5.4
332
328
333
329
The :class: `Symfony\\ Component\\ Filesystem\\ Path ` class was introduced in Symfony 5.4.
334
330
335
331
Dealing with file paths usually involves some difficulties:
336
332
337
- - System Heterogeneity : file paths look different on different platforms. UNIX
333
+ - Platform differences : file paths look different on different platforms. UNIX
338
334
file paths start with a slash ("/"), while Windows file paths start with a
339
335
system drive ("C:"). UNIX uses forward slashes, while Windows uses backslashes
340
- by default ("") .
336
+ by default.
341
337
- Absolute/relative paths: web applications frequently need to deal with absolute
342
- and relative paths. Converting one to the other properly is tricky and
343
- repetitive.
338
+ and relative paths. Converting one to the other properly is tricky and repetitive.
344
339
345
340
:class: `Symfony\\ Component\\ Filesystem\\ Path ` provides utility methods to tackle
346
341
those issues.
@@ -509,7 +504,6 @@ to obtain the root of a path::
509
504
510
505
echo Path::getRoot("C:\Programs\Apache\Config");
511
506
// => C:/
512
- >>>>>>> a992f6342 ([Filesystem] Add documentation for the Path class)
513
507
514
508
Error Handling
515
509
--------------
0 commit comments