Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

af_crkey(3) [debian man page]

af_files(3)						    Attribute Filesystem (AtFS) 					       af_files(3)

NAME
af_crkey, af_open, af_close, af_rm, af_establish, af_restore - AtFS file system operations SYNOPSIS
#include <stdio.h> #include <atfs.h> int af_crkey (char *syspath, char *name, char *type, Af_key *aso) FILE *af_open (Af_key *aso, char *mode) int af_close (FILE *stream) int af_rm (Af_key *aso) int af_establish (Af_key *aso, char *filename) int af_restore (Af_key *aso, Af_key *restoredAso) DESCRIPTION
af_crkey creates an object key for a regular UNIX file identified by name, type and system path. syspath is an either absolute or relative directory name. An empty syspath refers to the current directory. By convention, AtFS interprets the filename suffix of a UNIX file as type and the filename without suffix as name attribute. To give an example, the path name /usr/andy/foo.c is split up in /usr/andy (syspath) foo (name) c (type) A period as first character in the filename is always considered as part of the name. Hence .cshrc has a name but no type. "." and ".." are recognized as names too. If the named UNIX file does not exist, af_crkey creates an empty file. The created key remains accessible until it is explicitly given up by af_dropkey (manual page af_retrieve(3)). af_open opens the contents of the ASO pointed to by aso and associates a stream with it. A pointer to the FILE structure associated with the stream is returned. Mode is a character string that is either "r[+]", "w[+]" or "a[+]". See fopen(3) for further details. Upon error, af_open returns a NULL pointer. Non-busy ASOs can only be opened with mode "r". If a non-busy ASO is opened, it's contents will be placed in a temporary UNIX file due to storage of versions as deltas. af_close closes a stream previously opened by af_open (see fclose(3)). Temporary files created by af_open, holding the contents of a saved versions are unlinked right after being opened so that they will automatically disappear on closing. af_rm removes the specified ASO. The application has to have a lock (see af_lock(3)) set on the ASO that shall be deleted by af_rm. ASOs with the state attribute set to accessed or frozen cannot be removed. If you keep multiple keys of one object (perhaps in different sets) af_rm invalidates all keys of the removed object. As AtFS does not support multiple links to saved ASOs, af_rm on a saved version always does a physical removal. af_establish establishes the contents of the saved version, pointed to by aso in a file named filename. The resulting file gets the ver- sion's modification and access date. af_restore is used to restore formerly saved derived ASOs into their old file location. It also restores the file modification and access date. This function cannot be applied to source objects. af_restore returns the key of the restored version in the buffer restoredAso. SEE ALSO
fopen(3), fclose(3), af_retrieve(3), af_lock(3) DIAGNOSTICS
Upon error, -1 or a nil pointer (depending on the return type) is returned and af_errno is set to the corresponding error number. AtFS-1.71 Fri Jun 25 14:33:07 1993 af_files(3)

Check Out this Related Man Page

af_lock(3)						    Attribute Filesystem (AtFS) 						af_lock(3)

NAME
af_lock, af_unlock, af_testlock - mechanism for reserving update rights in AtFS SYNOPSIS
#include <atfs.h> Af_user *af_lock (Af_key *aso, Af_user *locker) Af_user *af_unlock (Af_key *aso) Af_user *af_testlock (Af_key *aso) DESCRIPTION
This manual page describes the interface to the AtFS locking mechanism. Locks are used to avoid conflicting updates to one object history. After a user has reserved the update rights, no other user may add new versions to the reserved history. Reserving the update rights hap- pens by locking the most recent version of the history. As AtFS allows adding new versions to each generation in a history, each genera- tion may be locked separately. Reserving update rights for old generations (with generation numbers smaller than the newest generation) are performed by locking the most recent version of the corresponding generation. Removing an ASO (af_rm - manual page af_files(3)) and chang- ing an ASO's version number (af_svnum - manual page af_version(3)) also requires a lock on the corresponding ASO. af_lock reserves the update permission for the user identified by locker. On successful completion, a buffer identical to locker is returned, a NULL pointer otherwise. af_unlock cancels a formerly established reservation of update rights. Only the owner or the locker of an ASO (identified by the Af_user structure that was given to the corresponding call of af_lock) are allowed to do this. On successful completion, af_unlock returns a buffer containing the identification of the former locker. This may be empty, if the ASO was not locked. Upon error, a NULL pointer is returned. af_testlock returns a buffer containing an identification of the current locker of the specified ASO. It returns an empty buffer, if no lock is set. SEE ALSO
af_version(3), af_files(3) DIAGNOSTICS
af_lock and af_unlock return -1 on error and af_errno is set to indicate the error number. AtFS-1.71 Fri Jun 25 14:33:11 1993 af_lock(3)
Man Page