diff --git a/cp-url-syntax.go b/cp-url-syntax.go index 1e522be7..8ac67b4e 100644 --- a/cp-url-syntax.go +++ b/cp-url-syntax.go @@ -114,7 +114,9 @@ func checkCopySyntaxTypeC(srcURLs []string, tgtURL string, isRecursive bool) { srcURL := srcURLs[0] _, srcContent, err := url2Stat(srcURL) - if err != nil && !isURLPrefixExists(srcURL) { + // incomplete uploads are not necessary for copy operation, no need to verify for them. + isIncomplete := false + if err != nil && !isURLPrefixExists(srcURL, isIncomplete) { fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.") } diff --git a/ls-main.go b/ls-main.go index 5109cd6a..4ddc478f 100644 --- a/ls-main.go +++ b/ls-main.go @@ -95,9 +95,11 @@ func checkListSyntax(ctx *cli.Context) { URLs, err := args2URLs(ctx.Args()) fatalIf(err.Trace(ctx.Args()...), fmt.Sprintf("One or more unknown URL types passed.")) + isIncomplete := ctx.Bool("incomplete") + for _, url := range URLs { _, _, err := url2Stat(url) - if err != nil && !isURLPrefixExists(url) { + if err != nil && !isURLPrefixExists(url, isIncomplete) { fatalIf(err.Trace(url), "Unable to stat ‘"+url+"’.") } } diff --git a/mirror-url.go b/mirror-url.go index 878a5bfc..3dba773c 100644 --- a/mirror-url.go +++ b/mirror-url.go @@ -61,7 +61,9 @@ func checkMirrorSyntax(ctx *cli.Context) { /****** Generic rules *******/ _, srcContent, err := url2Stat(srcURL) - if err != nil && !isURLPrefixExists(srcURL) { + // incomplete uploads are not necessary for copy operation, no need to verify for them. + isIncomplete := false + if err != nil && !isURLPrefixExists(srcURL, isIncomplete) { fatalIf(err.Trace(srcURL), "Unable to stat source ‘"+srcURL+"’.") } diff --git a/url.go b/url.go index 72734cf6..e3642004 100644 --- a/url.go +++ b/url.go @@ -77,13 +77,13 @@ func url2Stat(urlStr string) (client client.Client, content *client.Content, err } // isURLPrefixExists - check if object key prefix exists. -func isURLPrefixExists(urlPrefix string) bool { +func isURLPrefixExists(urlPrefix string, incomplete bool) bool { clnt, err := url2Client(urlPrefix) if err != nil { return false } isRecursive := true - isIncomplete := false + isIncomplete := incomplete for entry := range clnt.List(isRecursive, isIncomplete) { if entry.Err != nil { return false