afc

package
v1.0.186 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 15 Imported by: 4

Documentation

Index

Constants

View Source
const (
	READ_ONLY                = Mode(0x00000001)
	READ_WRITE_CREATE        = Mode(0x00000002)
	WRITE_ONLY_CREATE_TRUNC  = Mode(0x00000003)
	READ_WRITE_CREATE_TRUNC  = Mode(0x00000004)
	WRITE_ONLY_CREATE_APPEND = Mode(0x00000005)
	READ_WRITE_CREATE_APPEND = Mode(0x00000006)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.0.185

type Client struct {
	// contains filtered or unexported fields
}

func New added in v1.0.71

func New(d ios.DeviceEntry) (*Client, error)

New creates a connection to the afc service

func NewFromConn

func NewFromConn(d ios.DeviceConnectionInterface) *Client

NewFromConn establishes a new AFC client connection from an existing device connection

func (*Client) Close added in v1.0.185

func (c *Client) Close() error

Close the afc client

func (*Client) DeviceInfo added in v1.0.185

func (c *Client) DeviceInfo() (DeviceInfo, error)

DeviceInfo retrieves information about the filesystem of the device

func (*Client) List added in v1.0.185

func (c *Client) List(p string) ([]string, error)

List all entries of the provided path

func (*Client) MkDir added in v1.0.185

func (c *Client) MkDir(p string) error

MkDir creates a directory at the specified path

func (*Client) Open added in v1.0.185

func (c *Client) Open(p string, mode Mode) (*File, error)

Open opens a file with the specified name in the given mode

func (*Client) Pull added in v1.0.185

func (conn *Client) Pull(srcPath, dstPath string) error

func (*Client) PullSingleFile added in v1.0.185

func (c *Client) PullSingleFile(srcPath, dstPath string) error

func (*Client) Push added in v1.0.185

func (conn *Client) Push(srcPath, dstPath string) error

func (*Client) Remove added in v1.0.185

func (c *Client) Remove(p string) error

Remove deletes the file at the given path If the path is a non-empty directory, an error will be returned

func (*Client) RemoveAll added in v1.0.185

func (c *Client) RemoveAll(p string) error

RemoveAll deletes the file at the given path If the path is a non-empty directory, the directory and its contents will be deleted

func (*Client) Stat added in v1.0.185

func (c *Client) Stat(s string) (FileInfo, error)

Stat retrieves information about a given file path

func (*Client) WalkDir added in v1.0.185

func (c *Client) WalkDir(p string, f WalkFunc) error

WalkDir traverses the filesystem starting at the provided path It calls the WalkFunc for each file, and if the file is a directory, it recursively traverses the directory

func (*Client) WriteToFile added in v1.0.185

func (conn *Client) WriteToFile(reader io.Reader, dstPath string) error

type DeviceInfo added in v1.0.185

type DeviceInfo struct {
	Model      string
	TotalBytes uint64
	FreeBytes  uint64
	BlockSize  uint64
}

type File added in v1.0.185

type File struct {
	// contains filtered or unexported fields
}

File is a reference to a file on the devices filesystem

func (*File) Close added in v1.0.185

func (f *File) Close() error

func (*File) Read added in v1.0.185

func (f *File) Read(p []byte) (int, error)

func (*File) Write added in v1.0.185

func (f *File) Write(p []byte) (int, error)

type FileInfo

type FileInfo struct {
	Name       string
	Type       FileType
	Mode       uint32
	Size       int64
	LinkTarget string
}

func (FileInfo) IsDir

func (f FileInfo) IsDir() bool
func (f FileInfo) IsLink() bool

type FileType added in v1.0.185

type FileType string
const (
	// S_IFDIR marks a directory
	S_IFDIR FileType = "S_IFDIR"
	// S_IFDIR marks a regular file
	S_IFMT  FileType = "S_IFMT"
	S_IFLNK FileType = "S_IFLNK"
)

type Mode added in v1.0.185

type Mode uint64

type WalkFunc added in v1.0.185

type WalkFunc func(path string, info FileInfo, err error) error

WalkFunc is used by Client.WalkDir for traversing directories This function will be called for each entry in a directory Execution can be controlled by returning error values from this function:

  • fs.SkipDir will skip files of the current directory
  • fs.SkipAll will stop traversal and exit without an error
  • returning any other non-nil error will stop traversal and return this error from Client.WalkDir

Jump to

Keyboard shortcuts

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