qid

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2018 License: BSD-2-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package qid provides the qid type and supporting functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Qid

type Qid struct {
	Type    Type
	Version uint32
	Path    uint64
}

Qid represents the server's unique identification for a file.

Two files on the same server hierarchy are the same if and only if their Qids are the same. (The client may have multiple Fids pointing to a single file on a server and hence having a single Qid.) The Qid fields hold a type, specifying whether the file is a directory, append-only file, etc., the Qid Version and the Qid Path. The Path is an integer unique among all files in the hierarchy. If a file is deleted and recreated with the same name in the same directory, the old and new path components of the Qids should be different. The Version is a version number for a file; typically, it is incremented every time the file is modified.

func FileInfo

func FileInfo(fi os.FileInfo) Qid

FileInfo creates a neinp.Qid from os.FileInfo, using Sys of FileInfo if possible.

func Generic

func Generic(fi os.FileInfo) Qid

Generic creates a neinp.Qid not using FileInfo.Sys().

func (*Qid) Decode

func (q *Qid) Decode(r io.Reader) (int64, error)

Decode reads the Qid data from an io.Reader.

func (*Qid) Encode

func (q *Qid) Encode(w io.Writer) (int64, error)

Encode writes the 9p representation of the qid to an io.Writer.

type Type

type Type uint8

Type represents the type this qid symbolizes.

const (
	// TypeFile is a plain file
	TypeFile Type = 0x00

	// TypeSymlink is a symbolic link
	TypeSymlink Type = 0x02

	// TypeTmp is a non-backed-up file
	TypeTmp Type = 0x04

	// TypeAuth is an authentication file
	TypeAuth Type = 0x08

	// TypeMount is a mounted channel
	TypeMount Type = 0x10

	// TypeExcl is a exclusive use file
	TypeExcl Type = 0x20

	// TypeAppend is a append only file
	TypeAppend Type = 0x40

	// TypeDir is a directory
	TypeDir Type = 0x80
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL