Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. S_IRUSR S_IWUSR

S_IRUSR S_IWUSR

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
4 Posts 4 Posters 0 Views 1 Watching
  • 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.
  • _ Offline
    _ Offline
    _Flaviu
    wrote on last edited by
    #1

    I have following line of code:

    open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);

    which generate 2 errors:

    error C2065: 'S_IRUSR' : undeclared identifier
    error C2065: 'S_IWUSR' : undeclared identifier

    I've read on internet that these IDs are declared inside #include but inside this file I don't have such IDs. But I replaced them with:

    open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);

    (I mean: S_IREAD | S_IWRITE) Just to be sure, it is ok like that ?

    L D CPalliniC 3 Replies Last reply
    0
    • _ _Flaviu

      I have following line of code:

      open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);

      which generate 2 errors:

      error C2065: 'S_IRUSR' : undeclared identifier
      error C2065: 'S_IWUSR' : undeclared identifier

      I've read on internet that these IDs are declared inside #include but inside this file I don't have such IDs. But I replaced them with:

      open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);

      (I mean: S_IREAD | S_IWRITE) Just to be sure, it is ok like that ?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      The first thing to do is check the Linux/UNIX documentation to see what those flags represent. You can then figure out which Windows flags to use as replacements.

      1 Reply Last reply
      0
      • _ _Flaviu

        I have following line of code:

        open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);

        which generate 2 errors:

        error C2065: 'S_IRUSR' : undeclared identifier
        error C2065: 'S_IWUSR' : undeclared identifier

        I've read on internet that these IDs are declared inside #include but inside this file I don't have such IDs. But I replaced them with:

        open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);

        (I mean: S_IREAD | S_IWRITE) Just to be sure, it is ok like that ?

        D Offline
        D Offline
        David Crow
        wrote on last edited by
        #3

        _Flaviu wrote:

        it is ok like that ?

        As long as S_IREAD has the same value as S_IRUSR and S_IWRITE has the same value as S_IWUSR.

        "One man's wage rise is another man's price increase." - Harold Wilson

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

        1 Reply Last reply
        0
        • _ _Flaviu

          I have following line of code:

          open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);

          which generate 2 errors:

          error C2065: 'S_IRUSR' : undeclared identifier
          error C2065: 'S_IWUSR' : undeclared identifier

          I've read on internet that these IDs are declared inside #include but inside this file I don't have such IDs. But I replaced them with:

          open(pathname, O_RDWR | O_CREAT | O_TRUNC, S_IREAD | S_IWRITE);

          (I mean: S_IREAD | S_IWRITE) Just to be sure, it is ok like that ?

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          Quote:

          it is ok like that ?

          Yes.[^]

          In testa che avete, signor di Ceprano?

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups