Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , ,

Sponsored Links



Implementation of mkdir() : C

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 02-02-2010
Member
 
Join Date: Dec 2009
Posts: 33
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!!
Reply With Quote
  #2  
Old 02-02-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,937
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.
Reply With Quote
  #3  
Old 02-02-2010
Member
 
Join Date: May 2008
Posts: 1,990
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.
Reply With Quote
  #4  
Old 02-02-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,976
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 );
}
Reply With Quote
  #5  
Old 02-02-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
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
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 11:13 AM.