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

int smbc_creat ( const char *  furl,
mode_t  mode 

Create a file on an SMB server.

Same as calling smbc_open() with flags = O_CREAT|O_WRONLY|O_TRUNC

furl The smb url of the file to be created
mode mode specifies the permissions to use if a new file is created. It is modified by the process's umask in the usual way: the permissions of the created file are (mode & ~umask)
NOTE, the above is not true. We are dealing with an SMB server, which has no concept of a umask!

Valid file handle, < 0 on error with errno set:
  • ENOMEM Out of memory
  • EINVAL if an invalid parameter passed, like no file, or smbc_init not called.
  • EEXIST pathname already exists and O_CREAT and O_EXCL were used.
  • EISDIR pathname refers to a directory and the access requested involved writing.
  • EACCES The requested access to the file is not allowed
  • ENOENT A directory component in pathname does not exist.
  • ENODEV The requested share does not exist.
See also:

Definition at line 716 of file libsmbclient.c.

References smbc_open().


      if (!smbc_initialized) {

            errno = EINVAL;
            return -1;


      return smbc_open(path, creat_bits, mode);

Generated by  Doxygen 1.6.0   Back to index