1 00:00:00,300 --> 00:00:07,360 In this part, we are going to talk about the filesystem modules that they went and looked at and maybe 2 00:00:07,360 --> 00:00:13,450 we would do the files, create files, a pen files, create and delete folders and also digital files. 3 00:00:13,590 --> 00:00:19,820 So first we need therapy letter code and then to import the file system. 4 00:00:19,830 --> 00:00:21,900 What else we can do this by? 5 00:00:22,990 --> 00:00:33,770 Taiping Constant is equal to required access and a stand for the final test are module's, and you can 6 00:00:33,770 --> 00:00:40,570 then do whatever you want, but commercially but commercially, we name it as the more dunam. 7 00:00:40,720 --> 00:00:43,190 And first we are going to create a new start. 8 00:00:45,040 --> 00:00:50,560 And inside the trial, we type some test that you want and I just type. 9 00:00:50,590 --> 00:00:52,360 Welcome to Mobile. 10 00:00:54,100 --> 00:01:00,730 So the first thing is we are going to do the week follow and to read the file, we are going to type 11 00:01:00,740 --> 00:01:14,680 after I week file and then we choose the path and we can use the dot and then for look, and since they 12 00:01:14,680 --> 00:01:18,910 are inside the same folder, we can just. 13 00:01:20,060 --> 00:01:30,710 Type of text is also OK, so the second argument is the error and they her and then I'm going to check 14 00:01:30,710 --> 00:01:41,910 if there's error, we are going to a lock error and we are going to console load the data. 15 00:01:42,740 --> 00:01:50,300 So if we run the program by typing, not if we can we can get the buffer right here. 16 00:01:50,440 --> 00:01:51,920 You can log to the console. 17 00:01:52,040 --> 00:01:57,110 And if we want to see the actual string we can use to string method. 18 00:01:57,410 --> 00:02:05,060 So we type to string and then we run looked at again, it will turn to welcome to a mobile so we can 19 00:02:05,060 --> 00:02:12,110 try to put inside another folder and then we put the text inside a folder. 20 00:02:12,290 --> 00:02:15,030 And every one days you can see this error. 21 00:02:15,470 --> 00:02:22,580 So if we want to with this file, we can type the correct pop by using Smash and then became mobile 22 00:02:22,880 --> 00:02:24,500 and then they'll start texte. 23 00:02:25,040 --> 00:02:28,960 And every one days you can see we can see the message again. 24 00:02:29,090 --> 00:02:38,920 So the next part is if we want to write the file, we can copy and paste here and then we come in this 25 00:02:38,930 --> 00:02:45,410 code and then instead of using we file method, we are going to use right file. 26 00:02:45,590 --> 00:02:52,430 And inside here we are going to type the content that we want to write. 27 00:02:52,610 --> 00:03:00,020 So we type in the message and then we karate's to a new method created. 28 00:03:00,560 --> 00:03:06,290 So if we try to run the program now, you can see a new message created. 29 00:03:06,290 --> 00:03:12,330 And if we go to the text file, you can see in new message already authorized. 30 00:03:12,570 --> 00:03:14,270 Welcome to Mobile. 31 00:03:14,390 --> 00:03:20,280 So how about if we just want to spend a new message rather than overwrite this? 32 00:03:20,300 --> 00:03:23,200 So, for example, this is a Panfilo. 33 00:03:23,420 --> 00:03:31,760 So now we copy and paste here and we command this code and then instead of using right file, we use 34 00:03:31,760 --> 00:03:35,690 append file and then we type a new message, too. 35 00:03:35,870 --> 00:03:37,520 And then we run the program. 36 00:03:37,520 --> 00:03:44,640 And as you can see inside, that has a new message to is created rather than overwrite the whole message. 37 00:03:44,660 --> 00:03:51,820 But how about if we just want to type the message in a different light and we can do this by doing that 38 00:03:51,830 --> 00:03:57,980 works out and and then we run the program again and we go to a doctor text. 39 00:03:58,010 --> 00:04:02,360 You can see a new message to create it in the second night. 40 00:04:03,350 --> 00:04:11,320 So now if we try to create a new photo, we can copy and paste here and we command and then we use make 41 00:04:11,340 --> 00:04:12,080 directory. 42 00:04:12,350 --> 00:04:20,150 And then we typed for the name, for example, the new folder, if no error, a message, new food are 43 00:04:20,150 --> 00:04:22,740 created will be locked in the console. 44 00:04:22,850 --> 00:04:27,100 So we run the app and now you can see a new folder is created. 45 00:04:27,200 --> 00:04:34,170 But if we try to create a folder again and you can see it already exists, so we can check where that 46 00:04:34,310 --> 00:04:43,100 photo already exists by using its App Store exit thing and new folder will create a directory, but 47 00:04:43,100 --> 00:04:45,440 we should check if it's not accessed. 48 00:04:45,830 --> 00:04:53,420 So we should type a exclamation mark who represent if not accessed, it will create a folder and otherwise 49 00:04:53,600 --> 00:04:57,980 we will lock the folder already exist. 50 00:04:58,610 --> 00:05:03,080 So if we run the program, you can see the message that already exists. 51 00:05:03,090 --> 00:05:10,040 But now if we did this folder and then we run the program, you can see it, you can create a folder. 52 00:05:10,190 --> 00:05:14,050 So now we are going to delete the folder to delete a photo. 53 00:05:14,060 --> 00:05:21,320 We can duplicate this bunch of code and commands this and we type delete folder. 54 00:05:21,740 --> 00:05:25,870 So we check if it exists, it will delete the folder. 55 00:05:26,180 --> 00:05:32,070 So we use remove directory and then we control the lock the folder deleted. 56 00:05:33,920 --> 00:05:38,870 And if there's no folder here, we will say the folder already deleted. 57 00:05:39,530 --> 00:05:44,660 So now if we run the program, you can see the folder, the new folder will delete. 58 00:05:44,880 --> 00:05:49,760 And if we try to run again, you can see the folder already deleted. 59 00:05:50,000 --> 00:05:53,940 So at last, we want to demonstrate how to date the file. 60 00:05:54,090 --> 00:05:57,320 So and this is similar to delete folder. 61 00:05:57,320 --> 00:05:59,590 So we copy and paste here. 62 00:05:59,810 --> 00:06:06,650 And again, we can manage the previous code and we are going to check if there are no stop text access. 63 00:06:06,680 --> 00:06:10,170 So we copy this path and pace here. 64 00:06:10,550 --> 00:06:14,500 So if it exists, we are going to unlink the text file. 65 00:06:14,960 --> 00:06:19,530 If there's no error, we will say the file is deleted by the. 66 00:06:19,630 --> 00:06:27,340 Why lies the file already deleted, so we take a look on the next stop and try to run, look at it and 67 00:06:27,340 --> 00:06:30,130 you can see the note started already deleted.