Hello and welcome to the goal and programming language course in the previous session.
We talked about create an empty fine and in this session, we want to talk about the other files and
directories concept.
Create a directory or folder and go blank in-car DVR function can be used to create a directory or folder
and go in the air creates a new directory with the specified name and permission beats.
If there is an error, it will be a time Asterix parser.
Now you can see the syntax.
This function takes into promises.
Name five existing, the first parameter is the name directory.
If the name directory is a fully qualified pass, it will create a directory at that press.
If not, it'll be create a directory with respect to current working directory.
Perm type is fine.
The second parameter is specifies the permission beats.
Now let's go to this school program to illustrate how to create a directory or folder and go like.
First, we want to create a folder or directory at the Fool Qualified Pass by encode the air function.
The return value of this function is an error, so we define a variable like e are colon equals.
Invoke ENCODE the our function from OS package
CIT Fool destination via the folder name.
For the example, the colon backslash backslash for the example temp and set permission zero seven five
five zero seven five five means read and execute access for everyone and authorized access for the owner
of the file.
Now we could create a directory at the foon qualified past name 10, and we assign returns value to
a variable like error.
Now we check the print message for us if the error is not empty.
Go to the next line if error not equal, Neal.
In this case, we use the Fartown function of the long package.
Lock the Fattore.
And sit around and sage reformat the code, save the project and execute the program.
Now go to drive D
and select the files and directory by the air.
And now we can see the 10 folder is here.
OK, now let's do another example.
First, create a folder or directory at the current pass.
By the end, call the air function.
So two clear the last quote first, defining a variable like error calling equals always start, then
called the i r set the folder name like 10th and set version zero seven five five.
Now we could create a directory at current pass and name type and the assign return values to a variable
like error.
So we check the print and message for us if the road is not empty.
So if they're not equals name from the package like FATTORE and set or reformat the called Save the
Project and execute the program, go to the current pass.
And execute the program.
So we go to diet three of these contests, and we can see the ten folder created here.
Okay.
We could create two directory at court current past and at the Fool Qualified Pass in order not to prolong
the time of decision.
We will finish it and we will continue the content in the next session.
Goodbye.