Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [SOLVED]file permission

    General and Desktop
    3
    6
    1916
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • saeedhardan
      saeedhardan last edited by

      hi ,
      why do i get this error :
      [quote]
      C2065: 'S_IWUSR' : undeclared identifier
      [/quote]
      although i included :
      [quote]
      #include <sys/types.h> //Specified in man 2 open
      #include <sys/stat.h>
      #include <stdlib.h>
      #include <errno.h> //Allows use of error numbers
      #include <fcntl.h> //Specified in man 2 open
      #include <stdio.h>
      [/quote]

      I'm using Qt Creator 3.1.2 to develop c++ . thanks .

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        Some details about the problem will help. What are you trying to do ? When do you get this error ? What is your program doing ?

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 0
        • saeedhardan
          saeedhardan last edited by

          sorry for that .
          @ ssh_session ssh = acs_session.get_ftp_ssh();
          sftp_session sftp;
          int rc;
          sftp = sftp_new(ssh);
          if (sftp == NULL)
          {
          std::string err = ssh_get_error(ssh);
          QWidget tmp;
          QMessageBox::critical(&tmp,QObject::tr("Error"),QObject::tr("Error allocating SFTP session: ")+ QString(err.c_str())+ QObject::tr("\n"));
          return false;
          }
          rc = sftp_init(sftp);
          if (rc != SSH_OK)
          {
          std::string err = ssh_get_error(ssh);
          QWidget tmp;
          QMessageBox::critical(&tmp,QObject::tr("Error"),QObject::tr("Error initializing SFTP session: ")+QString(err.c_str())+QObject::tr("\n"));
          sftp_free(sftp);
          return rc;
          }
          rc = sftp_mkdir(sftp, acs_session.get_ftp_username(), S_IWUSR);
          if (rc != SSH_OK)@

          this is snippet of the code , basically im using libssh to transfer file to a remote pc , using the function :
          [quote]
          sftp_mkdir(sftp, acs_session.get_ftp_username(), S_IWUSR);
          [/quote]
          im creating a remote directory .
          this is the function:
          @
          int sftp_mkdir (sftp_session sftp, const char *directory, mode_t mode)
          @

          1 Reply Last reply Reply Quote 0
          • dheerendra
            dheerendra Qt Champions 2022 last edited by

            S_IWUSR is undeclared identifier. It means that definition is not here anywhere in your program. It must be coming from third party library. Just try to find out this definition in your library package.

            Dheerendra
            @Community Service
            Certified Qt Specialist
            http://www.pthinks.com

            1 Reply Last reply Reply Quote 0
            • A
              andreyc last edited by

              I guess that you are using VS studio compiler.
              I don't think it includes S_IWUSR definition. See "this doc":http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx

              I would suggest to define it in your project.
              @
              #define S_IWUSR 00200
              @

              1 Reply Last reply Reply Quote 0
              • saeedhardan
                saeedhardan last edited by

                thanks u very much.

                [quote author="andreyc" date="1410968337"]I guess that you are using VS studio compiler.
                I don't think it includes S_IWUSR definition. See "this doc":http://msdn.microsoft.com/en-us/library/z0kc8e3z.aspx
                [/quote]
                yeah im using VS :/ .
                on linux it compiles fine .

                also iv'e found all the values of the permissions :
                "File permissions":http://man7.org/linux/man-pages/man2/fstat.2.html

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post