Package os implements a subset of the Go "os" package. See for details.

    Note that the current implementation is blocking. This limitation should be removed in a future version.



    This section is empty.


    View Source
    var (
    	Stdin  = &File{0, "/dev/stdin"}
    	Stdout = &File{1, "/dev/stdout"}
    	Stderr = &File{2, "/dev/stderr"}

      Stdin, Stdout, and Stderr are open Files pointing to the standard input, standard output, and standard error file descriptors.

      View Source
      var (
      	ErrUnsupported = errors.New("operation not supported")

        Portable analogs of some common system call errors.


        This section is empty.


        type File

        type File struct {
        	// contains filtered or unexported fields

          File represents an open file descriptor.

          func NewFile

          func NewFile(fd uintptr, name string) *File

            NewFile returns a new File with the given file descriptor and name.

            func (*File) Close

            func (f *File) Close() error

              Close closes the File, rendering it unusable for I/O.

              func (*File) Fd

              func (f *File) Fd() uintptr

                Fd returns the integer Unix file descriptor referencing the open file. The file descriptor is valid only until f.Close is called.

                func (*File) Read

                func (f *File) Read(b []byte) (n int, err error)

                  Read reads up to len(b) bytes from the File. It returns the number of bytes read and any error encountered. At end of file, Read returns 0, io.EOF.

                  func (*File) Write

                  func (f *File) Write(b []byte) (n int, err error)

                    Write writes len(b) bytes to the File. It returns the number of bytes written and an error, if any. Write returns a non-nil error when n != len(b).