 Hey everybody, this is Brian and welcome to the 24th LAMP tutorial. We're going to be continuing our discussion on the file system. As you can see, the file system is vastly complex and you are in luck if you're familiar with the Linux and Unix system because most of the commands are identical, like change group, change mode, change mod, copy, delete, etc., etc., removed, etc., all those things, they're all in here. Pretty simple, pretty easy to use. We're going to go over a couple of these just to kind of get you in the field for how the file system works. We already have a test.txt from the previous tutorial. So we're just going to say echo file exists. Does the file exist? True. Because the file exists. I'm actually going to turn that into a variable, make it a little easier to work with here. There we go. Does the file exist just or now? So then you can write code like if file exists, file, copying the file, and then you can say copy. That's how it wants a source and a destination. So the source will be, let's go out to our directory here, and you see how we have a test.txt, but we don't have a test.txt, so let's actually say that and copying the file. I probably should have put a hard return in there. So let's get rid of this guy. You can see how we now have a test.txt, and then you can go in and say, got a little ahead of myself there. Now in case you notice me fumbling around with the command, the actual command here I believe is unlink. There we go. And some of the commands are a little different. Like unlink doesn't actually exist in Linux. Actually I think it does. It's I think remove file and delete and all that stuff is an alias for it. Not exactly sure to be brutally honest with you about that. So we're just going to go file deleted. So what we're doing here real quick is we've got a file variable called test.txt. If this file exists, then we're going to copy the file into desk.txt. If that file exists, meaning copy, work correctly, then we're going to just simply delete it and say the file was deleted. Copying the file, file is deleted. So as you can see, you can very easily work with the file system. Some little gotchas is you may or may not have permission in the directory that you're working in, especially with third-party hosts. Sometimes they will not allow you to write or delete files via PHP. So if you're working with a script and then suddenly it just bloop stops working or you go to write a file and nothing happens or throws an error message, you might want to contact your vendor and say, hey look, I need read write access to this stuff. Typically, you can do a little test just by writing a text file out like we showed in the previous tutorial and seeing what happens. Many times when you order your server, you can tell them specifically, hey, I'm going to have this directory structure, whatever it may be, and in this special folder I need read write access. So go through and look up the W3 school's PHP reference for the file system and you can actually see a list of all of the commands. Unfortunately, we don't have time to really go through these or we would end up with like a 5,000 video tutorial just on the file system. Some of these get pretty in-depth, some of these you'll probably never ever use and some of them you use constantly like file exists. So this is Brian, thank you for watching. I hope you found this educational and entertaining.