Recent

Author Topic: How to set extended file attributes?  (Read 3766 times)

vicot

  • Full Member
  • ***
  • Posts: 114
How to set extended file attributes?
« on: March 04, 2014, 08:35:03 pm »
I need to set extended file attributes (xattr) on Linux. Is there any Lazarus library already that allows me to do that?

In addition to the extX family, I will probably need to set the xattrs for the XFS filesystem.

Any help is appreciated.

I would gladly welcome examples or snippets of code.

Thanks


Kays

  • Full Member
  • ***
  • Posts: 214
  • Whasup!?
    • KaiBurghardt.de
Re: How to set extended file attributes?
« Reply #1 on: April 09, 2014, 04:21:00 pm »
I need to set extended file attributes (xattr) on Linux. Is there any Lazarus library already that allows me to do that?
AFAIK nope.

I hardly wish to use xattrs in Pascal, too. I've been realizing my small programs with setfattr & getfattr in bash scripts – not so nice.
So if I got it right, we need the translated C headers for libattr1. The relevant headers are libattr1-dev. cp /usr/include/attr/* /tmp/attr/.
Creating bindings for C libs describes, that there's a h2paswizard, but I simply can't find it. Mh. Fortunately just h2pas libattr.h works. error_context.h needs h2paspp error_context.h first. But h2pas complains about syntax errors in attributes.h and xattr.h. As I'm home with Pascal I have absolutely no idea what it doesn't like about the mentioned lines. Do you?
Yours Sincerely
Kai Burghardt

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Kays

  • Full Member
  • ***
  • Posts: 214
  • Whasup!?
    • KaiBurghardt.de
Re: How to set extended file attributes?
« Reply #3 on: April 09, 2014, 05:36:18 pm »
Question was solved;

Indeed. This topic was one of the top search results, so that's why I got landed here.
Yours Sincerely
Kai Burghardt

 

TinyPortal © 2005-2018