Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ setfiletype(2) — Sprite KS.390

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chown(2)

stat(2)

SETFILETYPE  —  C Library Procedures

NAME

setfiletype − change advisory file type of file

SYNOPSIS

setfiletype(path, type)
char ∗path;
int type;

DESCRIPTION

The file whose name is given by path has its type changed to type. Types are defined in <fs.h>.

FS_USER_TYPE_UNDEFINED 0no type set
FS_USER_TYPE_TMP 1temporary file
FS_USER_TYPE_SWAP       2swap file
FS_USER_TYPE_OBJECT     3object file
FS_USER_TYPE_BINARY4executable
FS_USER_TYPE_OTHER      5file that doesn’t correspond to any specific type

The advisory file type is used by the system for statistics gathering.  At some point in the future, it may be used for performance enhancements as well: for example,  varying the amount of time allowed before flushing a file to disk, depending on the importance of not losing data from it. 

Only the owner of a file (or the super-user) may change its type. 

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

ERRORS

Setfiletype will fail and the file type will be unchanged if:

[ENOTDIR] A component of the path prefix is not a directory. 

[EINVAL] The pathname contains a character with the high-order bit set. 

[ENAMETOOLONG]
A component of a pathname exceeded 255 characters, or an entire path name exceeded 1023 characters.

[ENOENT] The named file does not exist. 

[EACCES] Search permission is denied for a component of the path prefix. 

[ELOOP] Too many symbolic links were encountered in translating the pathname. 

[EPERM] The effective user ID does not match the owner of the file and the effective user ID is not the super-user. 

[EROFS] The named file resides on a read-only file system. 

[EFAULT] Path points outside the process’s allocated address space. 

[EIO] An I/O error occurred while reading from or writing to the file system. 

SEE ALSO

chown(2), stat(2)
 

Sprite version 1.0  —  January 18, 1989

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026