// Create creates the named file with mode 0666 (before umask) - It's actually 0644, truncating it if it already exists. If successful, methods on the returned File can be used for I/O; the associated file descriptor has mode O_RDWR.
func(wwithPkger)Create(pstring)(File,error){
pt,err:=w.base.Create(p)
iferr!=nil{
ifw.parent!=nil{
returnw.parent.Create(p)
}
returnpt,err
}
returnpt,nil
}
// MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission bits perm (before umask) are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing and returns nil.
// Open opens the named file for reading. If successful, methods on the returned file can be used for reading; the associated file descriptor has mode O_RDONLY.
func(wwithPkger)Open(pstring)(File,error){
pt,err:=w.base.Open(p)
iferr!=nil{
ifw.parent!=nil{
returnw.parent.Open(p)
}
returnpt,err
}
returnpt,nil
}
// Stat returns a FileInfo describing the named file.
func(wwithPkger)Stat(pstring)(os.FileInfo,error){
pt,err:=w.base.Stat(p)
iferr!=nil{
ifw.parent!=nil{
returnw.parent.Stat(p)
}
returnpt,err
}
returnpt,nil
}
// Walk walks the file tree rooted at root, calling walkFn for each file or directory in the tree, including root. All errors that arise visiting files and directories are filtered by walkFn. The files are walked in lexical order, which makes the output deterministic but means that for very large directories Walk can be inefficient. Walk does not follow symbolic links. - That is from the standard library. I know. Their grammar teachers can not be happy with them right now.
// Remove removes the named file or (empty) directory.
func(wwithPkger)Remove(pstring)error{
err:=w.base.Remove(p)
iferr!=nil{
returnerr
}
ifw.parent!=nil{
returnw.parent.Remove(p)
}
returnnil
}
// RemoveAll removes path and any children it contains. It removes everything it can but returns the first error it encounters. If the path does not exist, RemoveAll returns nil (no error).