From the course: PHP Techniques: Working with Files and Directories
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Filesystem basics - PHP Tutorial
From the course: PHP Techniques: Working with Files and Directories
Filesystem basics
- [Instructor] We'll begin learning to work with files and directories in PHP, by learning about some File system basics. The File system is the part of any computer that keeps files and directories organized. Usually, the File system is going to be on some type of storage media, like a hard drive, and every file or directory on the hard drive has a file path. The file path describes how to find the file. There are two types of file paths, absolute and relative. An absolute path would start at the beginning of the hard drive and list all of the directories that we'd have to go through to locate the file or directory that we are interested in. A relative path is similar, but instead of starting at the root of the hard drive, it's a path relative to another file. All files and directories also have file ownership and permissions, which control access to those files. If you have trouble reading or writing a file, it could be…
Contents
-
-
-
(Locked)
Filesystem basics6m 6s
-
Relative paths and magic constants4m 53s
-
(Locked)
Accessing files5m 4s
-
(Locked)
Reading from files4m 52s
-
(Locked)
Reading line by line5m 9s
-
(Locked)
File permissions5m 34s
-
(Locked)
Writing to files5m 5s
-
(Locked)
Writing line returns2m 28s
-
(Locked)
Deleting files2m 38s
-
(Locked)
Moving the file pointer7m 36s
-
(Locked)
Examining file details6m 52s
-
(Locked)
Challenge: Create a log file2m 2s
-
(Locked)
Solution: Create a log file3m 17s
-
(Locked)
-
-
-