You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// initialize the include map which contains the list of files to be included
129
171
// parse the string passed in include flag
@@ -260,12 +302,13 @@ type cookedCopyCmdArgs struct {
260
302
fromTo common.FromTo
261
303
262
304
// filters from flags
263
-
includemap[string]int
264
-
excludemap[string]int
265
-
recursivebool
266
-
followSymlinksbool
267
-
withSnapshotsbool
268
-
forceWritebool
305
+
listOfFilesToCopy []string
306
+
includemap[string]int
307
+
excludemap[string]int
308
+
recursivebool
309
+
followSymlinksbool
310
+
withSnapshotsbool
311
+
forceWritebool
269
312
270
313
// options from flags
271
314
blockSizeuint32
@@ -883,6 +926,8 @@ Copy an entire account with SAS:
883
926
cpCmd.PersistentFlags().BoolVar(&raw.withSnapshots, "with-snapshots", false, "include the snapshots. Only valid when the source is blobs.")
884
927
cpCmd.PersistentFlags().StringVar(&raw.include, "include", "", "only include these files when copying. "+
885
928
"Support use of *. Files should be separated with ';'.")
929
+
// This flag is implemented only for Storage Explorer.
930
+
cpCmd.PersistentFlags().StringVar(&raw.listOfFilesToCopy, "list-of-files", "", "defines the location of json which has the list of only files to be copied")
886
931
cpCmd.PersistentFlags().StringVar(&raw.exclude, "exclude", "", "exclude these files when copying. Support use of *.")
887
932
cpCmd.PersistentFlags().BoolVar(&raw.forceWrite, "overwrite", true, "overwrite the conflicting files/blobs at the destination if this flag is set to true.")
888
933
cpCmd.PersistentFlags().BoolVar(&raw.recursive, "recursive", false, "look into sub-directories recursively when uploading from local file system.")
@@ -909,6 +954,8 @@ Copy an entire account with SAS:
909
954
cpCmd.PersistentFlags().MarkHidden("acl")
910
955
911
956
// permanently hidden
957
+
// Hide the list-of-files flag since it is implemented only for Storage Explorer.
glcm.Info(fmt.Sprintf("error fetching properties of %s. Either it is a directory or getting the blob properties failed. For virtual directories try using the recursive flag", blobPath))
160
+
continue
161
+
}
162
+
// Since the given blob in the listOFFiles flag is not a blob, it can be a virtual directory
163
+
// If the virtual directory doesn't have a path separator at the end of it, then we should append it.
164
+
// This is done to avoid listing blobs which shares the common prefix i.e the virtual directory name.
165
+
// For Example:
166
+
// 1. source = "https://sdksampleperftest.blob.core.windows.net/bigdata" blob="100k". In this case, it is
167
+
// a possibility that we have blobs https://sdksampleperftest.blob.core.windows.net/bigdata/100K and
168
+
// https://sdksampleperftest.blob.core.windows.net/bigdata/100K/f1.txt. So we need to list the blob
0 commit comments