---
name: "af_misc"
section: "3"
platform: "linux"
package: "atfs-dev"
version: "1.4pl6-15+b1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/af_misc"
---

# af\_misc(3)

miscellaneous AtFS functions

## NAME

af\_afname, af\_afpath, af\_aftype, af\_afuser, af\_setarchpath, af\_version - miscellaneous AtFS functions

## SYNOPSIS

\#include \<atfs.h\>

char	\*af\_afname (char \*path)

char	\*af\_afpath (char \*path)

char	\*af\_aftype (char \*path)

Af\_user	\*af\_afuser (uit\_t uid)

char	\*af\_setarchpath (char \*path)

char	\*af\_version (void)

## DESCRIPTION

The functions *af\_afname, af\_afpath* and *af\_aftype* extract name, syspath or type from a given (operating system dependent) file identification. In an UNIX environment, a given pathname of the form

```
/usr/lib/libatfs.a leads to afname libatfs, afpath /usr/lib and aftype a.
```

If no path (eg. **otto.c**), or no type (eg. **/usr/hugo/Makefile**) is given, the corresponding routine returns an empty string. A period as first character in a filename is always considered to be part of the name (e.g. **.cshrc** has the name **.cshrc** and an empty type string). "**.**" and "**..**" are recognized as names. Archive file extensions and AtFS specific path extensions are stripped from the resulting name resp. pathname.\
 **Note:** af\_afname, af\_afpath and af\_aftype use static memory for the returned results. Subsequent calls of the same function overwrite former results.

*af\_afuser* returns an AtFS user identification which consists of the login name of the user identified by *uid*, the current host and the current domain. *Uid\_t* is defined according to the return type of *getuid (2)* on your system. The *Af\_user* type has the following structure

```
typedef struct {
	char	af_username[MAXUSERNAMELEN];
	char	af_userhost[MAXHOSTNAMELEN];
	char	af_userdomain[MAXDOMAIN+1];
	} Af_user;
```

*af\_setarchpath* defines the location of the AtFS archive files. A nil-pointer given as *path*-argument clears the former setting of the global archive path. af\_setarchpath returns the old global archive path. Initially, no global archive path is set. In this case, all archive files are stored in a subdirectory called **AtFS**, relative to the directory where corresponding busy version resides.

*af\_version* returns a string that names the version and the creator of the currently used AtFS library.

## SEE ALSO

[getuid(2)](/getuid/2.md)
