On Friday 23 September 2005 15:53, Ruben Lang wrote: > Hi bacula-users, > > i'm currently working on a little project where i have to get the > "File-Attributes" from the "File.LStat" field. I've already done some > research, but i could'nt find out how to read the contents of this field. > All i know is, that the file-attributes are received via stat() and > somehow put together with some additional attributes/information and > then base64 encoded. > For example the following content of a record (taken from the bacula-db > i'm using): > > gR DwABPN EHA C Pn Pn A G BAA A BC3sbr BC3moS BC3sbr A A C
The encoding/decoding of the "attributes" or stat packet are done in: <bacula-source>/src/findlib/attribs.c The base64 routines are Bacula home-brew, if I remember right, so you will need to look at that code too: <bacula-source>/src/lib/base64.c Unfortunately, when I wrote it, I didn't realize there was an RFC on base64 so my choice of the two special characters was different from the "standard". This will cause non-C/C++ programmers a bit of extra work :-( > > As i know the attributes are separated by spaces, so how to map the > upper string to (which) attributes. Since there are also > "Extended-Attributes", "Link" and so on, refering to the "Unix File > Attributes" - section of the developers manual. > In the above string there are 16 space separated, base64 encoded strings > (am i right ?) but stat() only returns 13 attributes. > > I'm working directly on the database, not using a software (trying to > write a script returning me the size of a given file). > > Would be great if someone can provide useful hints. > Thanks in advance, > > R. Lang > > > ------------------------------------------------------- > SF.Net email is sponsored by: > Tame your development challenges with Apache's Geronimo App Server. > Download it for free - -and be entered to win a 42" plasma tv or your very > own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php > _______________________________________________ > Bacula-users mailing list > Bacula-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/bacula-users -- Best regards, Kern ("> /\ V_V ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users