In this part, we are going to talk about the filesystem modules that they went and looked at and maybe
we would do the files, create files, a pen files, create and delete folders and also digital files.
So first we need therapy letter code and then to import the file system.
What else we can do this by?
Taiping Constant is equal to required access and a stand for the final test are module's, and you can
then do whatever you want, but commercially but commercially, we name it as the more dunam.
And first we are going to create a new start.
And inside the trial, we type some test that you want and I just type.
Welcome to Mobile.
So the first thing is we are going to do the week follow and to read the file, we are going to type
after I week file and then we choose the path and we can use the dot and then for look, and since they
are inside the same folder, we can just.
Type of text is also OK, so the second argument is the error and they her and then I'm going to check
if there's error, we are going to a lock error and we are going to console load the data.
So if we run the program by typing, not if we can we can get the buffer right here.
You can log to the console.
And if we want to see the actual string we can use to string method.
So we type to string and then we run looked at again, it will turn to welcome to a mobile so we can
try to put inside another folder and then we put the text inside a folder.
And every one days you can see this error.
So if we want to with this file, we can type the correct pop by using Smash and then became mobile
and then they'll start texte.
And every one days you can see we can see the message again.
So the next part is if we want to write the file, we can copy and paste here and then we come in this
code and then instead of using we file method, we are going to use right file.
And inside here we are going to type the content that we want to write.
So we type in the message and then we karate's to a new method created.
So if we try to run the program now, you can see a new message created.
And if we go to the text file, you can see in new message already authorized.
Welcome to Mobile.
So how about if we just want to spend a new message rather than overwrite this?
So, for example, this is a Panfilo.
So now we copy and paste here and we command this code and then instead of using right file, we use
append file and then we type a new message, too.
And then we run the program.
And as you can see inside, that has a new message to is created rather than overwrite the whole message.
But how about if we just want to type the message in a different light and we can do this by doing that
works out and and then we run the program again and we go to a doctor text.
You can see a new message to create it in the second night.
So now if we try to create a new photo, we can copy and paste here and we command and then we use make
directory.
And then we typed for the name, for example, the new folder, if no error, a message, new food are
created will be locked in the console.
So we run the app and now you can see a new folder is created.
But if we try to create a folder again and you can see it already exists, so we can check where that
photo already exists by using its App Store exit thing and new folder will create a directory, but
we should check if it's not accessed.
So we should type a exclamation mark who represent if not accessed, it will create a folder and otherwise
we will lock the folder already exist.
So if we run the program, you can see the message that already exists.
But now if we did this folder and then we run the program, you can see it, you can create a folder.
So now we are going to delete the folder to delete a photo.
We can duplicate this bunch of code and commands this and we type delete folder.
So we check if it exists, it will delete the folder.
So we use remove directory and then we control the lock the folder deleted.
And if there's no folder here, we will say the folder already deleted.
So now if we run the program, you can see the folder, the new folder will delete.
And if we try to run again, you can see the folder already deleted.
So at last, we want to demonstrate how to date the file.
So and this is similar to delete folder.
So we copy and paste here.
And again, we can manage the previous code and we are going to check if there are no stop text access.
So we copy this path and pace here.
So if it exists, we are going to unlink the text file.
If there's no error, we will say the file is deleted by the.
Why lies the file already deleted, so we take a look on the next stop and try to run, look at it and
you can see the note started already deleted.