afc

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2022 License: MIT Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

func NewFromConn

func NewFromConn(deviceConn ios.DeviceConnectionInterface) *Connection

NewFromConn allows to use AFC on a DeviceConnectionInterface, see crashreport for an example

func NewWithHouseArrest

func NewWithHouseArrest(device ios.DeviceEntry, bundleID string) (*Connection, error)

NewWithHouseArrest gives an AFC connection to an app container using the house arrest service

func (Connection) Close

func (conn Connection) Close() error

func (*Connection) Delete

func (conn *Connection) Delete(path string) error

Delete removes a given file or directory

func (*Connection) DownloadFile

func (conn *Connection) DownloadFile(file string, target io.Writer) error

DownloadFile streams filecontents of file from the device to the given writer.

func (*Connection) GetFileInfo

func (conn *Connection) GetFileInfo(path string) (FileInfo, error)

GetFileInfo gets basic info about the path on the device

func (*Connection) ListFiles

func (conn *Connection) ListFiles(cwd string, matchPattern string) ([]string, error)

ListFiles returns all files in the given directory, matching the pattern. Example: ListFiles(".", "*") returns all files and dirs in the current path the afc connection is in

func (*Connection) SendFile

func (conn *Connection) SendFile(fileContents []byte, filePath string) error

SendFile writes fileContents to the given filePath on the device FIXME: right now sends the entire byte array, will probably fail for larger files

type FileInfo

type FileInfo struct {
	StSize      int
	StBlocks    int
	StNlink     int
	StIfmt      string
	StMtime     uint64
	StBirthtime uint64
}

FileInfo a struct containing file info

func (FileInfo) IsDir

func (info FileInfo) IsDir() bool

IsDir checks if info.StIfmt == "S_IFDIR" which means the FileInfo is for a directory

Jump to

Keyboard shortcuts

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