diff --git a/cast-url.go b/cast-url.go index 7a34d85f..2c2b4047 100644 --- a/cast-url.go +++ b/cast-url.go @@ -177,10 +177,13 @@ func prepareSingleCastURLsTypeA(sourceURL string, targetURL string) castURLs { if !sourceContent.Type.IsRegular() { // Source is not a regular file return castURLs{Error: NewIodine(iodine.New(errInvalidSource{URL: sourceURL}, nil))} } + + /* // Too expensive. Lets ignore it for now. targetClient, err := target2Client(targetURL) if err != nil { return castURLs{Error: NewIodine(iodine.New(err, nil))} } + // Target exists? targetContent, err := targetClient.Stat() if err == nil { // Target exists. @@ -191,6 +194,7 @@ func prepareSingleCastURLsTypeA(sourceURL string, targetURL string) castURLs { targetContents = append(targetContents, targetContent) return castURLs{SourceContent: sourceContent, TargetContents: targetContents} } + */ // All OK.. We can proceed. Type A sourceContent.Name = sourceURL return castURLs{SourceContent: sourceContent, TargetContents: []*client.Content{{Name: targetURL}}} diff --git a/cmd-cast.go b/cmd-cast.go index 3892b0ff..fa3f90ab 100644 --- a/cmd-cast.go +++ b/cmd-cast.go @@ -159,6 +159,7 @@ func doPrepareCastURLs(session *sessionV2, trapCh <-chan bool) { console.Errorln(sURLs.Error) break } + /* We are going to copy any way now. Let it fail at the time of putObject if !globalForceFlag { if len(sURLs.TargetContents) > 0 { if sURLs.TargetContents[0].Size != 0 || !sURLs.TargetContents[0].Time.IsZero() { @@ -168,6 +169,7 @@ func doPrepareCastURLs(session *sessionV2, trapCh <-chan bool) { } } } + */ jsonData, err := json.Marshal(sURLs) if err != nil { diff --git a/cmd-cp.go b/cmd-cp.go index a7a3a002..1c412d7d 100644 --- a/cmd-cp.go +++ b/cmd-cp.go @@ -147,6 +147,7 @@ func doPrepareCopyURLs(session *sessionV2, trapCh <-chan bool) { console.Errorln(cpURLs.Error) break } + /* Too expensive. Ignore this for now. Let it fail while putObject. if !globalForceFlag { if cpURLs.TargetContent.Size != 0 || !cpURLs.TargetContent.Time.IsZero() { console.Fatalf("Destination already exists, cannot overwrite ā€˜%s’ with ā€˜%s’. "+ @@ -154,6 +155,7 @@ func doPrepareCopyURLs(session *sessionV2, trapCh <-chan bool) { break } } + */ jsonData, err := json.Marshal(cpURLs) if err != nil { diff --git a/cp-url.go b/cp-url.go index 73345a18..a4b92cd0 100644 --- a/cp-url.go +++ b/cp-url.go @@ -97,11 +97,13 @@ func prepareCopyURLsTypeA(sourceURL string, targetURL string) <-chan copyURLs { copyURLsCh <- copyURLs{Error: NewIodine(iodine.New(errInvalidSource{URL: sourceURL}, nil))} return } + /* Too expensive. Ignore this for now. Let it fail while putObject. targetClient, err := target2Client(targetURL) if err != nil { copyURLsCh <- copyURLs{Error: NewIodine(iodine.New(err, nil))} return } + // Target exists? targetContent, err := targetClient.Stat() if err == nil { // Target exists. @@ -112,6 +114,7 @@ func prepareCopyURLsTypeA(sourceURL string, targetURL string) <-chan copyURLs { copyURLsCh <- copyURLs{SourceContent: sourceContent, TargetContent: targetContent} return } + */ // All OK.. We can proceed. Type A sourceContent.Name = sourceURL copyURLsCh <- copyURLs{SourceContent: sourceContent, TargetContent: &client.Content{Name: targetURL}}