//go:build !unix package hostfiles import ( "context" "errors" "os" ) // The publisher reads a files directory by descriptor, without following // links, which needs openat. The agent runs on Linux; elsewhere this // package builds, restores and reads manifests, and does not publish. var errNoPublish = errors.New("hostfiles: publishing a directory is not supported on this OS") // restoreDirFlags is Restore's directory open off unix, where there is no // FIFO to wait on. const restoreDirFlags = os.O_RDONLY type dirHandle struct{ f *os.File } func openTree(path string) (*dirHandle, error) { return nil, errNoPublish } func handleOf(f *os.File) (*dirHandle, error) { return nil, errNoPublish } func (d *dirHandle) Close() error { return nil } func (d *dirHandle) Name() string { return "" } func syncTree(ctx context.Context, d *dirHandle, p *Publisher, skip func(string, bool) bool, visit func(*dirHandle, string, string) error) error { return errNoPublish } func (d *dirHandle) descend(rel string) (*dirHandle, bool, error) { return nil, false, errNoPublish } func readStable(d *dirHandle, name string) ([]byte, uint32, fileState, error) { return nil, 0, fileUnreadable, errNoPublish }