|
| |||||||||
| Tags: c language, directory, function, mkdir |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Implementation of mkdir() : C
Hello, I am student of the BscCS. I have the knowledge of the C language. Actually I would like to create the directory on my computer using the C program. But, I do not know anything about the function that can be used in the C language to create the directory. So, I would like to know about the Implementation of the mkdir() function in C language. I also would like to know how can I implement the mkdir() function in my C program to create the directory. Anyone has the solution for me on the mkdir() function reply me!! |
|
#2
| ||||
| ||||
| The mkdir() : C
Hi, To create the new directory in the c programming the the mkdir() function can be used with name of the path. The path name could be related to an absolute path name or to the current directory that can be working. You can be able to set the permission bits to the file of the newly created directory from mode. The mkdir() function is the well known function that can be used by the programmers to create their own directory. I hope it would be enough for you to know about the mkdir() function. |
|
#3
| |||
| |||
| Re: Implementation of mkdir() : C
The mkdir() function can be used for to create the sub-directory. The syntax of the mkdir() function can be as follows : #include <sys/types.h> #include <sys/stat.h> int mkdir( const char *pth, md_s mod ); the mkdir() function can returns the zero if there can be success and returns the -1if there an error can occurred. The errno can be set to state the error. |
|
#4
| ||||
| ||||
| Re: Implementation of mkdir() : C
The following program demonstrates you how can you create the directory. In following code a new directory called /mcom on node 3 : #include <sys/types.h> #include <sys/stat.h> void main() { mkdir( "//3/hd/mcom", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH ); } |
|
#5
| ||||
| ||||
| Re: Implementation of mkdir() : C
The mkdir() function can mark for update the satim, sctim and smtim fields of the directory, Upon the successful completion. The directory that can contains the new entry can be marked for the update whose parameters are the sctim and smtim fields. The following can be the list of the errors : 1. EACCES 2. EEXIST 3. EMLINK 4. ENAMETOOLONG 5. ENOENT 6. ENOSPC 7. ENOSYS 8. ENOTDIR 9. EROFS |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Implementation of mkdir() : C" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Implementation of vprintf() : C | Adolfa | Software Development | 4 | 28-01-2010 02:07 PM |
| Implementation of vsscanf() : C | Garrett | Software Development | 4 | 28-01-2010 10:58 AM |
| Mkdir with variable space | Kingfisher | Software Development | 5 | 19-12-2009 11:55 AM |
| Error mkdir() in PHP | GlassFish | Software Development | 3 | 28-11-2009 10:33 AM |
| mkdir with date | tom.henricksen@gmail.com | Windows Server Help | 4 | 17-03-2007 01:29 PM |