*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> standard/mkdir (2)              
Title
Content
Arch
Section
 

Contents


mkdir(2)							      mkdir(2)


NAME    [Toc]    [Back]

     mkdir - make a directory

C SYNOPSIS    [Toc]    [Back]

     #include <sys/types.h>
     #include <sys/stat.h>

     int mkdir (const char *path, mode_t mode);

DESCRIPTION    [Toc]    [Back]

     mkdir creates a new directory with	the name path. The mode	of the new
     directory is initialized from mode	(see chmod(2) for values of mode].
     The protection part of mode is modified by	the process's mode mask	(see
     umask(2)).	 The S_ISGID, S_ISUID, and S_ISVTX bits	are silently deleted
     from mode.

     The directory's owner ID is set to	the process's effective	user ID.  The
     directory's group ID is set to the	process's effective group ID or	the
     group ID of the directory in which	the directory is being created.	 This
     is	determined as follows:

     If	the underlying filesystem was mounted with the BSD file	creation
     semantics flag (see fstab(4)) or the S_ISGID bit is set (see chmod(2)) on
     the parent	directory, then	the group ID of	the new	 is set	to the group
     ID	of the parent directory, otherwise it is set to	the effective group ID
     of	the calling process.

     The newly created directory is empty with the possible exception of
     entries for itself	(.)  and its parent directory (..).

     Upon successful completion, mkdir marks for update	the st_atime, st_ctime
     and st_mtime fields of the	directory.  Also, the st_ctime and st_mtime
     fields of the directory that contains the new entry are marked for
     update.

     mkdir will	fail and no directory will be created if one or	more of	the
     following are true:

     [ENOTDIR]	      A	component of the path prefix is	not a directory.

     [ENOENT]	      A	component of the path prefix does not exist.

     [ENAMETOOLONG]   The length of the	path argument exceeds {PATH_MAX}, or a
		      pathname component is longer than	{NAME_MAX}.

     [EACCES]	      Either a component of the	path prefix denies search
		      permission or write permission is	denied on the parent
		      directory	of the directory to be created.

     [EEXIST]	      The named	file already exists.





									Page 1






mkdir(2)							      mkdir(2)



     [EROFS]	      The path prefix resides on a read-only filesystem.

     [EFAULT]	      Path points outside the allocated	address	space of the
		      process.

     [ELOOP]	      Too many symbolic	links were encountered in translating
		      path.

     [EMLINK]	      The maximum number of links to the parent	directory
		      would exceed {LINK_MAX}.

     [ENOSPC]	      The directory in which the entry for the new directory
		      is being placed cannot be	extended because there is no
		      space left on the	filesystem containing the directory or
		      the new directory	cannot be created because there	is no
		      space left on the	filesystem that	will contain the
		      directory	or there are no	free inodes on the filesystem
		      on which the directory is	being created.

     [EDQUOT]	      The directory in which the entry for the new directory
		      is being placed cannot be	extended either	because	the
		      user's quota of disk blocks on the filesystem containing
		      the directory has	been exhausted or the new directory
		      cannot be	created	because	the user's quota of disk
		      blocks on	the filesystem that will contain the directory
		      has been exhausted or the	user's quota of	inodes on the
		      filesystem on which the directory	is being created has
		      been exhausted.

     [EIO]	      An I/O error has occurred	while accessing	the
		      filesystem.

SEE ALSO    [Toc]    [Back]

      
      
     mkdir(1), chmod(2), mknod(2), umask(2), unlink(2),	fstab(4), stat(5)

DIAGNOSTICS    [Toc]    [Back]

     Upon successful completion, a value of 0 is returned.  Otherwise, a value
     of	-1 is returned,	and errno is set to indicate the error.


									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
dosmkdir HP-UX make a DOS directory
efi_mkdir HP-UX make an EFI directory
mkdir OpenBSD make a directory file
mkdir NetBSD make a directory file
mkdir HP-UX make a directory file
mkdir FreeBSD make a directory file
mmd Tru64 mtools utility to make a DOS directory
mklost+foun HP-UX make a lost+found directory for fsck(1M)
mkdtemp NetBSD make unique temporary file or directory name
mktemp NetBSD make unique temporary file or directory name
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service