User folder instead of directories in documentation

This commit is contained in:
Harshavardhana
2015-04-28 12:15:09 -07:00
parent 23cee677b7
commit 8ffd8d0f26
11 changed files with 44 additions and 43 deletions
+2 -2
View File
@@ -42,7 +42,7 @@ type configV1 struct {
Hosts map[string]*hostConfig
}
// getMcConfigDir - construct minio client configuration directory
// getMcConfigDir - construct minio client config folder
func getMcConfigDir() (string, error) {
u, err := user.Current()
if err != nil {
@@ -57,7 +57,7 @@ func getMcConfigDir() (string, error) {
}
}
// createMcConfigDir - create minio client configuration directory
// createMcConfigDir - create minio client config folder
func createMcConfigDir() error {
p, err := getMcConfigDir()
if err != nil {
+1 -1
View File
@@ -188,7 +188,7 @@ EXAMPLES:
}
mbCmd = cli.Command{
Name: "mb",
Usage: "Make a directory or bucket",
Usage: "Make a bucket or a folder",
Action: runMakeBucketCmd,
CustomHelpTemplate: `NAME:
mc {{.Name}} - {{.Usage}}
+2 -2
View File
@@ -91,10 +91,10 @@ func getNewTargetURLObject(targetURL string, sourceURL string) (newTargetURL str
func getNewTargetURLFilesystem(targetURL string, sourceURL string) (newTargetURL string, err error) {
st, err := os.Stat(targetURL)
if err != nil {
return "", iodine.New(errIsNotDIR{path: targetURL}, nil)
return "", iodine.New(errIsNotFolder{path: targetURL}, nil)
}
if !st.IsDir() {
return "", iodine.New(errIsNotDIR{path: targetURL}, nil)
return "", iodine.New(errIsNotFolder{path: targetURL}, nil)
}
switch client.GetType(sourceURL) {
case client.Filesystem:
+2 -2
View File
@@ -64,10 +64,10 @@ func doCopySingleSource(methods clientMethods, sourceURL, targetURL string, sour
if err != nil {
return iodine.New(err, nil)
}
// check if its a directory, construct the new TargetURL, if not fallback
// check if its a folder, construct the new TargetURL, if not fallback
newTargetURL, err := getNewTargetURL(targetURL, sourceURL)
switch iodine.ToError(err).(type) {
case errIsNotDIR:
case errIsNotFolder:
return doCopy(methods, reader, md5hex, length, targetURL, targetConfig)
case errIsNotBucket:
return doCopy(methods, reader, md5hex, length, targetURL, targetConfig)
+1 -1
View File
@@ -2,7 +2,7 @@
```go
NAME:
mc mb - Make a directory or bucket
mc mb - Make a bucket or a folder
USAGE:
mc mb TARGET [TARGET...]
+13 -12
View File
@@ -19,26 +19,27 @@ USAGE:
mc [global flags] command [command flags] [arguments...]
VERSION:
1e2357c0c9cbdb6d5cb46de4c0d9ef28
9b3f0a923efd39cd98487c08b761dbd0
BUILD:
2015-04-28 10:20:42.810860315 -0700 PDT
2015-04-28 11:59:38.77226527 -0700 PDT
COMMANDS:
ls List files and objects
cp Copy objects and files
cat Concantenate objects or files to standard output
mb Make a directory or bucket
access Set permissions [public, private, readonly] for buckets and folders.
config Generate configuration "/home/harsha/.mc/config.json" file.
update Check for new software updates
cp Copy objects and files from multiple sources single destination
sync Copies files and objects from single source to multiple destinations
cat Concantenate objects or files to standard output
mb Make a bucker or a folder
access Set permissions [public, private, readonly] for buckets and folders.
config Generate configuration "/home/harsha/.mc/config.json" file.
update Check for new software updates
GLOBAL FLAGS:
--theme "minimal" Choose a console theme from this list [*minimal*, nocolor, white]
--debug Enable HTTP tracing
--quiet, -q Supress chatty console output
--retry "5" Number of retry count
--version, -v print the version
--debug Enable HTTP tracing
--quiet, -q Supress chatty console output
--retry "5" Number of retry count
--version, -v print the version
```
+3 -3
View File
@@ -114,10 +114,10 @@ func (e errInvalidSource) Error() string {
return "Invalid source " + e.path
}
type errIsNotDIR struct {
type errIsNotFolder struct {
path string
}
func (e errIsNotDIR) Error() string {
return "Not a directory " + e.path
func (e errIsNotFolder) Error() string {
return "Not a folder " + e.path
}
+2 -2
View File
@@ -54,7 +54,7 @@ func printItem(date time.Time, v int64, name string, fileType os.FileMode) {
}
}
// doList - list all entities inside a directory
// doList - list all entities inside a folder
func doList(clnt client.Client, targetURL string) error {
var err error
for itemCh := range clnt.List() {
@@ -70,7 +70,7 @@ func doList(clnt client.Client, targetURL string) error {
return nil
}
// doListRecursive - list all entities inside directories and sub-directories recursively
// doListRecursive - list all entities inside folders and sub-folders recursively
func doListRecursive(clnt client.Client, targetURL string) error {
var err error
for itemCh := range clnt.ListRecursive() {
+2 -2
View File
@@ -32,12 +32,12 @@ import (
"github.com/minio-io/minio/pkg/utils/log"
)
// Check for the environment early on and gracefuly report.
// Check for the environment early on and gracefully report.
func checkConfig() {
_, err := user.Current()
if err != nil {
log.Debug.Println(iodine.New(err, nil))
console.Fatalln("Unable to determine user's home directory")
console.Fatalln("Unable to determine current user")
}
// If config doesn't exist, do not attempt to read it
+5 -5
View File
@@ -49,7 +49,7 @@ func New(path string) client.Client {
func (f *fsClient) fsStat() (os.FileInfo, error) {
st, err := os.Stat(filepath.Clean(f.path))
if os.IsNotExist(err) {
return nil, iodine.New(FileNotFound{path: f.path}, nil)
return nil, iodine.New(NotFound{path: f.path}, nil)
}
if err != nil {
return nil, iodine.New(err, nil)
@@ -64,7 +64,7 @@ func (f *fsClient) Get() (io.ReadCloser, int64, string, error) {
return nil, 0, "", iodine.New(err, nil)
}
if item.FileType.IsDir() {
return nil, 0, "", iodine.New(FileISDir{path: f.path}, nil)
return nil, 0, "", iodine.New(ISFolder{path: f.path}, nil)
}
body, err := os.Open(f.path)
if err != nil {
@@ -95,7 +95,7 @@ func (f *fsClient) GetPartial(offset, length int64) (io.ReadCloser, int64, strin
return nil, 0, "", iodine.New(err, nil)
}
if item.FileType.IsDir() {
return nil, 0, "", iodine.New(FileISDir{path: f.path}, nil)
return nil, 0, "", iodine.New(ISFolder{path: f.path}, nil)
}
if offset > item.Size || (offset+length-1) > item.Size {
return nil, 0, "", iodine.New(client.InvalidRange{Offset: offset}, nil)
@@ -123,7 +123,7 @@ func (f *fsClient) GetPartial(offset, length int64) (io.ReadCloser, int64, strin
return body, length, md5Str, nil
}
// List - list files and directories inside a directory
// List - list files and folders
func (f *fsClient) List() <-chan client.ItemOnChannel {
itemCh := make(chan client.ItemOnChannel)
go f.list(itemCh)
@@ -187,7 +187,7 @@ func (f *fsClient) list(itemCh chan client.ItemOnChannel) {
}
}
// ListRecursive - list all files and directories recursivelys
// ListRecursive - list files and folders recursively
func (f *fsClient) ListRecursive() <-chan client.ItemOnChannel {
itemCh := make(chan client.ItemOnChannel)
go f.listRecursive(itemCh)
+11 -11
View File
@@ -21,23 +21,23 @@ type GenericFileError struct {
path string
}
// FileNotFound (ENOENT) - file not found
type FileNotFound GenericFileError
// NotFound (ENOENT) - file not found
type NotFound GenericFileError
func (e FileNotFound) Error() string {
func (e NotFound) Error() string {
return "Requested file " + e.path + " not found"
}
// FileISDir (EISDIR) - accessed file is a directory
type FileISDir GenericFileError
// ISFolder (EISDIR) - accessed file is a folder
type ISFolder GenericFileError
func (e FileISDir) Error() string {
return "Requested file " + e.path + " is a directory"
func (e ISFolder) Error() string {
return "Requested file " + e.path + " is a folder"
}
// FileNotDir (ENOTDIR) - accessed file is not a directory
type FileNotDir GenericFileError
// NotFolder (ENOTDIR) - accessed file is not a folder
type NotFolder GenericFileError
func (e FileNotDir) Error() string {
return "Requested file " + e.path + " is not a directory"
func (e NotFolder) Error() string {
return "Requested file " + e.path + " is not a folder"
}