mirror of
https://github.com/rclone/rclone.git
synced 2025-08-17 17:11:37 +02:00
link: allow creating public link to files and folders - closes #1562
This commit is contained in:
@@ -1470,6 +1470,15 @@ func Rcat(fdst fs.Fs, dstFileName string, in io.ReadCloser, modTime time.Time) (
|
||||
return dst, nil
|
||||
}
|
||||
|
||||
// PublicLink adds a "readable by anyone with link" permission on the given file or folder.
|
||||
func PublicLink(f fs.Fs, remote string) (string, error) {
|
||||
doPublicLink := f.Features().PublicLink
|
||||
if doPublicLink == nil {
|
||||
return "", errors.Errorf("%v doesn't support public links", f)
|
||||
}
|
||||
return doPublicLink(remote)
|
||||
}
|
||||
|
||||
// Rmdirs removes any empty directories (or directories only
|
||||
// containing empty directories) under f, including f.
|
||||
func Rmdirs(f fs.Fs, dir string, leaveRoot bool) error {
|
||||
|
Reference in New Issue
Block a user