Giter VIP home page Giter VIP logo

crossxattr's Introduction

crossxattr

Cross platform extended attributes C code for another project.

This project is unfinished.

Support is currently implemented for FreeBSD and GNU+Linux.

Functions

All extended attributes are operated on in the USER namespace. Extended attributes of links are not planned to be supported (although there is no reason why not).

ssize_t getAttr( const char* path, const char* attrname, void* data, size_t nbytes );
ssize_t setAttr( const char* path, const char* attrname, const void* data, size_t nbytes );
ssize_t deleteAttr( const char* path, const char* attrname );
ssize_t listAttrs( const char* path, void* data, size_t nbytes );
  • path - path to the file to be operated upon

  • attrname - the name of the attribute, not specifying the namespace

  • nbytes - the size of the buffer data

  • data - the buffer for the result of the operation

  • For getAttr data is set to the value of the specified attribute,

  • For setAttr data is the value to which the specified attribute is set,

  • For listAttrs data is set to be a NULL seperated list of the names of the attributes which are in the USER namespace of the file: e.g.

name1\0name2\0name3\0...

Return Values

They return -1 on failure (everything other than attribute does not exist is caught internally).

Otherwise they return whatever the relevant syscall returns.

The one exception to this is listAttrs. This returns the number of entries in data.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.