atprint(3)
β¨ atprint(3) β the AtFS Toolkit Library bestie page β¨
okay so picture this: you're deep in the AtFS Toolkit Library and you need to turn weird internal attribute values into strings a human can actually read, or do the reverse and turn a string back into a number. that's literally this whole page. five little functions, one very specific job. let's get into it π
πΈ NAME πΈ
atWriteStatus, atWriteMode, atWriteDate, atWriteName, atScanStatus β print and scan special attribute values π
π SYNOPSIS π
#include <atfs.h>
#include <atfstk.h>
char*atWriteStatus (Af_key *aso; int verbose);
char*atWriteMode (Af_key *aso);
char*atWriteDate (Af_key *aso, char *dateAttribute);
char*atWriteName (Af_key *aso, char *path);
int atScanStatus (char *statusStr);
π DESCRIPTION π
π¦ atWriteStatus
atWriteStatus hands you back a string representation of the Asos AF_STATE attribute. that's it, that's the job. β¨
here's the tea tho β the verbose argument changes everything:
- if
verboseisTRUE, you get the long status name (8 characters, iconic). - if
verboseisFALSE, you get the short one-character representation (lowkey minimal, we love her).
and in any case, the result value is a statically defined string. so like, it lives in static memory. noted. π
π atWriteMode
atWriteMode generates an ls -l(1)-like string representation (think -rwxr-xr-x, the classic) of the AF_MODE attribute. π«Ά
it returns its result in static memory, which will be overwritten on subsequent calls. so if you were planning to hold onto it and call this again, bestieβ¦ don't. copy it first. π
β atWriteDate
atWriteDate produces a date string from the given dateAttribute, meant to be used for ls -l(1)-like output (for example Jan 8 11:07 or Jul 10 1992). πΈ
the format of the date string depends on the value of the date attribute. the rules, periodt:
- the string is always 12 characters long and begins with the month and day.
- for dates younger than 6 months, the third field is the time.
- for dates older than 6 months, the third field is the year.
the result string resides in static memory, which will be overwritten on subsequent calls. same warning as before, same energy, be careful. π
π atWriteName
atWriteName generates a bound pathname from path and aso. simple, clean, no notes. β¨
π atScanStatus
atScanStatus converts a status string to an internal numeric status value. it understands various abbreviations β including the one character status strings generated by atWriteStatus. so it's giving "i can read what she writes", a true duo, iykyk. π
π BUGS π
the format switch in afWriteDate (for dates older than six months) does not happen at exactly the right time. it may be a few days later. π not me discovering this at 3am. it's a known thing, it's fine, we move.
and that's the page, bestie!! this one's from AtFStk-1.12, dated Fri Jun 25 16:39:43 1993 β yeah she's vintage, she's a classic, she ate and left no crumbs πβ¨π
π¦ where this page comes from
- debian bookworm: atfs-dev 1.4pl6-15+b1
- ubuntu jammy: atfs-dev 1.4pl6-15
- ubuntu noble: atfs-dev 1.4pl6-16.1build1
- ubuntu resolute: atfs-dev 1.4pl6-17
- ubuntu stonking: atfs-dev 1.4pl6-17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms