MCPcopy Create free account
hub / github.com/dropbox/dbxcli / downloadDestinationPath

Function downloadDestinationPath

cmd/get.go:411–435  ·  view source on GitHub ↗
(dst string)

Source from the content-addressed store, hash-verified

409}
410
411func downloadDestinationPath(dst string) (string, error) {
412 for i := 0; i < 255; i++ {
413 info, err := os.Lstat(dst)
414 if err != nil {
415 if os.IsNotExist(err) {
416 return dst, nil
417 }
418 return "", err
419 }
420 if info.Mode()&os.ModeSymlink == 0 {
421 return dst, nil
422 }
423
424 target, err := os.Readlink(dst)
425 if err != nil {
426 return "", err
427 }
428 if !filepath.IsAbs(target) {
429 target = filepath.Join(filepath.Dir(dst), target)
430 }
431 dst = target
432 }
433
434 return "", fmt.Errorf("too many symlinks resolving %s", dst)
435}
436
437func downloadFileOnce(dbx filesClient, arg *files.DownloadArg, dst string, errOut io.Writer) (*files.FileMetadata, error) {
438 res, contents, err := dbx.DownloadContext(currentContext(), arg)

Callers 2

downloadFileOnceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected