Hello and welcome to the golden programming language course in this session.
We want to talk about files and directories concept.
Files and directories.
The most important package that allows us to manipulate files and directories as entities is the OAS
package.
The I or package has the I o dot reader interface to reads and transfers data from a source into a stream
of bytes.
And I ordered rather interface reads data from a provided this stream or by and writes it as output
to a target resource.
Create and and define.
For this purpose, we use the create function of the obvious package, create function, creates or
try and chase the name fine.
If the phone already exists, it is truncated and if the find does not exist, it is created.
Now let's go to this school program to illustrate how to create an empty flight.
First, go to Panderer and create a project folder like file and directory and create a fine like making
the go create package
and create main function.
Now we want to create an end defined by create function.
Great function takes the fine name as an argument and creates it the retail value of this function is
a fine and a rule.
So first define two variable like empty five comma e all column equals invoke, create function from
OS package or s don't create function and set a name for five for the example.
A. P..
Now we could create defining current directory named A. And we assign return values to two variables
like and define and row.
Now we check the printed message for us if the error is not empty, if we are not equals need.
In this case, we use the fits all function of the package law that that's on and set the role, the
sage and else we use from opinions and formation of large package parts.
That means an empty
fine.
And in the end of main function, we close our file by the close function.
And to find the clothes reformative, who saved the project and executed the program first, go to the
Crozet followers
and run the program on.
OK, now we could create an and defined name on the the.
And we can see the file created large message in order not to prolong the time of decision, we will
finish it and we will continue the content in the next session.
Goodbye.