Logo Search packages:      
Sourcecode: samba-doc-ja version File versions

int smbc_mkdir ( const char *  durl,
mode_t  mode 
)

Create a directory.

Parameters:
durl The url of the directory to create
mode Specifies the permissions to use. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask).
Returns:
0 on success, < 0 on error with errno set:
  • EEXIST directory url already exists
  • EACCES The parent directory does not allow write permission to the process, or one of the directories
  • ENOENT A directory component in pathname does not exist.
  • EINVAL NULL durl passed or smbc_init not called.
  • ENOMEM Insufficient memory was available.
See also:
smbc_rmdir()

Definition at line 2055 of file libsmbclient.c.

{
      struct smbc_server *srv;
      fstring server, share, user, password, workgroup;
      pstring path;

      if (!smbc_initialized) {

            errno = EINVAL;
            return -1;

      }

      if (!fname) {

            errno = EINVAL;
            return -1;

      }
  
      DEBUG(4, ("smbc_mkdir(%s)\n", fname));

      smbc_parse_path(fname, server, share, path, user, password); /*FIXME, errors*/

      if (user[0] == (char)0) pstrcpy(user, smbc_user);

      pstrcpy(workgroup, lp_workgroup());

      srv = smbc_server(server, share, workgroup, user, password);

      if (!srv) {

            return -1;  /* errno set by smbc_server */

      }

      /* if (strncmp(srv->cli.dev, "IPC", 3) == 0) {

         mode = aDIR | aRONLY;

         }
         else if (strncmp(srv->cli.dev, "LPT", 3) == 0) {

         if (strcmp(path, "\\") == 0) {

         mode = aDIR | aRONLY;

         }
         else {

         mode = aRONLY;
         smbc_stat_printjob(srv, path, &size, &m_time);
         c_time = a_time = m_time;

         }
         else { */

      if (!cli_mkdir(&srv->cli, path)) {

            errno = smbc_errno(&srv->cli);
            return -1;

      } 

      return 0;

}


Generated by  Doxygen 1.6.0   Back to index