1 00:00:13,390 --> 00:00:16,810 Hello and welcome to the Golang programming language course. 2 00:00:17,380 --> 00:00:22,990 Independent musician, we talked about how to redefine and indecision. 3 00:00:23,020 --> 00:00:27,070 We want to talk about the other files and directories concept. 4 00:00:30,470 --> 00:00:31,830 How to ride. 5 00:00:31,880 --> 00:00:32,630 Define. 6 00:00:34,120 --> 00:00:41,810 Go Lang offers a vast, in-built library that can be used to perform, read and write operations. 7 00:00:42,300 --> 00:00:50,440 Enfance will be right the string in the fine using old start writing string function writers, doing 8 00:00:50,440 --> 00:00:57,570 functions, write the contents of this string and it returns the number of bytes written and it all 9 00:00:57,580 --> 00:00:58,150 is in. 10 00:00:59,110 --> 00:01:01,270 Now you can see the syntax. 11 00:01:01,810 --> 00:01:05,890 Let's go to the school program to write, define, 12 00:01:08,740 --> 00:01:14,320 first, create the font and name it to start text by the create function. 13 00:01:15,010 --> 00:01:19,030 This function takes the foreign name as an argument and creates it. 14 00:01:19,450 --> 00:01:26,320 The return value of this function is defined and and the rules in case an error is thrown, it received 15 00:01:26,320 --> 00:01:30,490 by the IRR variable, and that's all a function of luck. 16 00:01:31,150 --> 00:01:40,510 So first, define two variable like fine and you are calling equals in the create function from always 17 00:01:40,510 --> 00:01:53,230 the package and set a fine then like test the tasty prints, the error message and stops program execution. 18 00:01:53,860 --> 00:02:08,890 If we are not equals to need, so call fatal function from like package but a function and sets a message 19 00:02:10,900 --> 00:02:23,680 like failed to create a fine person s and set our message. 20 00:02:26,380 --> 00:02:32,470 The author is used for purpose of clean up like closing running fine after the fine has been written 21 00:02:32,690 --> 00:02:35,710 and main function has completed execution. 22 00:02:35,710 --> 00:02:39,910 So right, write the author finds that close. 23 00:02:42,190 --> 00:02:46,120 Now read the text and defined by Connie write a string function. 24 00:02:46,510 --> 00:02:51,910 This function will return to values for the example in variable chapters. 25 00:02:51,910 --> 00:02:55,330 The length of this and written to define and error variable. 26 00:02:56,440 --> 00:03:10,170 So define two variable like Len and E are calling equals call write issing function from Phi Phi Dart, 27 00:03:10,630 --> 00:03:16,960 write a string function and set a value like hello. 28 00:03:18,820 --> 00:03:20,830 And then from. 29 00:03:23,030 --> 00:03:25,190 To practice medicine, 30 00:03:28,010 --> 00:03:28,550 go. 31 00:03:30,660 --> 00:03:31,530 Programming 32 00:03:35,340 --> 00:03:36,240 language. 33 00:03:38,220 --> 00:03:45,600 Prince, the error message and the staff's program execution is a road not equals need. 34 00:03:47,950 --> 00:03:57,990 So go to what is statement of if and right message from on Earth of light package Lord God, Father 35 00:03:58,030 --> 00:04:14,290 Earth and sit in the sage failed writing to find cursed is and said a raw message. 36 00:04:18,930 --> 00:04:27,240 Now we use name function that returns the name of define as presented, created middle and display length 37 00:04:27,270 --> 00:04:39,900 of the file by following codes for the example that if backslash and forehead name calling persons is. 38 00:04:41,650 --> 00:04:53,040 And since he finds that name function and go to the next line if batches and lengths 39 00:04:55,290 --> 00:05:02,250 persons, the bonds assets lend value. 40 00:05:03,890 --> 00:05:08,850 OK, reformat the code, save the project and execute the program. 41 00:05:12,540 --> 00:05:21,630 Now we can see the output first, fine test, the text we created and we can see fine main test, the 42 00:05:21,630 --> 00:05:29,550 text and length is four or five bytes, so we were able to say the setup is strings inside the file 43 00:05:30,000 --> 00:05:32,730 in order not to prolong the time of decision. 44 00:05:32,790 --> 00:05:36,750 We'll finish it and we will continue the content in the next session. 45 00:05:36,930 --> 00:05:37,560 Goodbye.