1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package fsdef
- /*
- fsdef.go
- This package handle error related to file systems.
- See comments below for usage.
- */
- import "errors"
- var (
- /*
- READ WRITE PERMISSIONS
- */
- FsReadOnly = "readonly"
- FsWriteOnly = "writeonly"
- FsReadWrite = "readwrite"
- FsDenied = "denied"
- /*
- ERROR TYPES
- */
- //Redirective Error
- ErrRedirectParent = errors.New("Redirect:parent")
- ErrRedirectCurrentRoot = errors.New("Redirect:root")
- ErrRedirectUserRoot = errors.New("Redirect:userroot")
- //Resolve errors
- ErrVpathResolveFailed = errors.New("FS_VPATH_RESOLVE_FAILED")
- ErrRpathResolveFailed = errors.New("FS_RPATH_RESOLVE_FAILED")
- ErrFSHNotFOund = errors.New("FS_FILESYSTEM_HANDLER_NOT_FOUND")
- //Operation errors
- ErrOperationNotSupported = errors.New("FS_OPR_NOT_SUPPORTED")
- ErrNullOperation = errors.New("FS_NULL_OPR")
- )
- //Generate a File Manager redirection error message
- func NewRedirectionError(targetVpath string) error {
- return errors.New("Redirect:" + targetVpath)
- }
- //Check if a file system is network drive
- func IsNetworkDrive(fstype string) bool {
- if fstype == "webdav" || fstype == "ftp" {
- return true
- }
- return false
- }
|