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. NTFS extended file attributes in C++

NTFS extended file attributes in C++

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++workspace
4 Posts 3 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.
  • G Offline
    G Offline
    gokings
    wrote on last edited by
    #1

    I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks

    D T 2 Replies Last reply
    0
    • G gokings

      I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks

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

      gokings wrote: ...NTFS extended file attributes... Just so we are on the same page here, what is your definition of "NTFS extended file attributes."


      "When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen

      1 Reply Last reply
      0
      • G gokings

        I wish to read and write NTFS extended file attributes in C++. I was very surprised that I did not find this information readily available. First I am assuming that NTFS extended file attributes are name-value pairs of strings. Is this correct? May I create a name and a value and attach that to a file as an extended file attribute? Presuming that that is correct, how do I 1) Determine whether a file supports extended file attributes (resides on a NTFS drive) 2) Read the extended file attributes 3) Set the extended file attributes I am in a VC++ 6 environment. Thanks

        T Offline
        T Offline
        Toby Opferman
        wrote on last edited by
        #3

        GetVolumeInformation() will tell you if the driver is NTFS. GetFileSecurity() can also tell you, if it fails you're not on NTFS and will get the "Security Information" if this is what you mean by extended. GetFileAttributes() works on basic FAT r/w/h/s attributes. GetFileAttributesEx() gets a few more attributes. GetFileInformationByHandle() gets a bunch of crap. Or are you talking about "extended attributes" as in: Extended Attribute Information Used by file servers that are linked with OS/2 systems. This attribute type isn't useful to Windows NT. Extended Attributes Used by file servers that are linked with OS/2 systems. This attribute type

        G 1 Reply Last reply
        0
        • T Toby Opferman

          GetVolumeInformation() will tell you if the driver is NTFS. GetFileSecurity() can also tell you, if it fails you're not on NTFS and will get the "Security Information" if this is what you mean by extended. GetFileAttributes() works on basic FAT r/w/h/s attributes. GetFileAttributesEx() gets a few more attributes. GetFileInformationByHandle() gets a bunch of crap. Or are you talking about "extended attributes" as in: Extended Attribute Information Used by file servers that are linked with OS/2 systems. This attribute type isn't useful to Windows NT. Extended Attributes Used by file servers that are linked with OS/2 systems. This attribute type

          G Offline
          G Offline
          gokings
          wrote on last edited by
          #4

          Thanks for the info! I have found that NTFS does not support extended attributes in the sense that OS/2 does (unfortunately, in my opinion). However, it does support multiple data streams. Normally, the default (unnamed) data stream is accessed. I can use a named data stream to achieve my purpose, though I have to jump through a few hoops. Thanks for the feedback!

          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