hydra-kernel-0.18.1: hydra-kernel-json/hydra/core/file.json
{
"name": "hydra.core.file",
"metadata": {
"description": "A model for file-system paths and metadata. Several types here are drawn from the POSIX <sys/stat.h> specification; see https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_stat.h.html",
"comments": [],
"seeAlso": [],
"provisions": []},
"dependencies": [{"module": "hydra.core.time"}],
"definitions": [
{
"type": {
"name": "hydra.core.file.FileExtension",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {"wrap": {"literal": "string"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "A file extension (without the dot), e.g. \"json\" or \"py\""}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.file.FilePath",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {"wrap": {"literal": "string"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "A host file-system path; a POSIX \"pathname\" (XBD section 3.254), i.e. a string used to identify a file. Named FilePath rather than Pathname so that the kernel type is self-describing and distinct from Hydra's other notions of paths"}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.file.FileStatus",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"record": [
{
"name": "fileType",
"type": {
"annotated": {
"body": {"variable": "hydra.core.file.FileType"},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "st_mode (file type bits) / the type of the file"}}}]}}}},
{
"name": "size",
"type": {
"annotated": {
"body": {"literal": {"integer": "int64"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "st_size / the size of the file in bytes. Well-defined for regular files and symbolic links; implementation-defined for other file types"}}}]}}}},
{
"name": "modificationTime",
"type": {
"annotated": {
"body": {"variable": "hydra.core.time.Timespec"},
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "st_mtim / the time of last data modification"}}}]}}}},
{
"name": "accessTime",
"type": {
"annotated": {
"body": {"optional": {"variable": "hydra.core.time.Timespec"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "st_atim / the time of last data access, if available. Optional, as it is unreliable or untracked on some filesystems and platforms (e.g. noatime mounts)"}}}]}}}},
{
"name": "statusChangeTime",
"type": {
"annotated": {
"body": {"optional": {"variable": "hydra.core.time.Timespec"}},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "st_ctim / the time of last file status change, if available. Optional, as this POSIX-specific notion does not map onto all platforms"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {
"literal": {
"string": "Metadata about a file, based on the POSIX struct stat. Only the portable, cross-platform subset of struct stat is modeled here; the following Unix-specific fields are omitted for now: st_dev (device ID), st_ino (inode number), st_mode permission bits (only the file type bits are kept, as fileType), st_nlink (hard link count), st_uid (owner user ID), st_gid (owner group ID), st_rdev (device ID for special files), st_blksize (preferred I/O block size), and st_blocks (number of blocks allocated). See <sys/stat.h> (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_stat.h.html)"}}}]}}},
"constraints": []}}},
{
"type": {
"name": "hydra.core.file.FileType",
"body": {
"variables": [],
"body": {
"annotated": {
"body": {
"union": [
{
"name": "block",
"type": {
"annotated": {
"body": "unit",
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "S_IFBLK / block special: a block special file (e.g. a disk device)"}}}]}}}},
{
"name": "character",
"type": {
"annotated": {
"body": "unit",
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "S_IFCHR / character special: a character special file (e.g. a terminal device)"}}}]}}}},
{
"name": "directory",
"type": {
"annotated": {
"body": "unit",
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "S_IFDIR / directory: a directory"}}}]}}}},
{
"name": "fifo",
"type": {
"annotated": {
"body": "unit",
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "S_IFIFO / FIFO special: a named pipe (FIFO)"}}}]}}}},
{
"name": "regular",
"type": {
"annotated": {
"body": "unit",
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "S_IFREG / regular: a regular file"}}}]}}}},
{
"name": "link",
"type": {
"annotated": {
"body": "unit",
"annotation": {
"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "S_IFLNK / symbolic link: a symbolic link"}}}]}}}},
{
"name": "socket",
"type": {
"annotated": {
"body": "unit",
"annotation": {"map": [{"key": {"variable": "description"}, "value": {"literal": {"string": "S_IFSOCK / socket: a socket"}}}]}}}}]},
"annotation": {
"map": [
{
"key": {"variable": "description"},
"value": {"literal": {"string": "An enumeration of POSIX file types, following the file type macros of <sys/stat.h>"}}}]}}},
"constraints": []}}}]}