fileoperations FileList property
Example
Return to Introduction  Previous page  Next page
Applies to
dcFileOperations component.  

Declaration
property FileList: TStrings;  

Description
The FileList property specifies one or more source file names (including full path). You should enumerate the source files or folders as items of this string list. The items can contain wildcard characters (? and *). If the file contains spaces you have to take it in quotes (i.e: C:\The Bitmap.bmp must be added as "C:\The Bitmap.bmp"). For example:  
 
FileList.Clear;  
 
FileList.Add('C:\myfiles\document??.txt');  
FileList.Add('C:\myfiles\picture.gif');  
  // long names must be in quotes !!  
FileList.Add('"C:\My Bitmaps\*.bmp"');  
  // or...  
for I := 0 to SomeItems.Count - 1 do  
  FileList.Add('"' + SomeItems[I] + '"')  
 
When you are using Copy or Move operations, these files will be copied or moved to the folder specified by the DestFolder property (If you call Delete, the files will be moved to "Recycled bin".)  
 
If you wish to specify multiple locations where you would like to store moved or copied files, you can describe new locations near the originals, spearating them by "=" sign.  
 
FileList[0]:='C:\myfiles\document??.txt=c:\mydocuments';  
FileList[1]:='C:\myfiles\picture.gif=d:\mypictures';  
FileList[2]:='"C:\My Bitmaps\*.bmp"="d:\bitmaps"';  
 
iiwarning If you would like to Rename some files, you must to specify new names, including the full path, separated from the originals by "=" sign. Unfortunately, due to strange behavior of the Windows Explorer, the files can not be renamed to different disk or directory, so new path must be equal to original. Example:  
 
FileList.Clear;  
FileList.Add('C:\myfiles\document.txt=c:\myfiles\mydoc.doc');  
FileList.Add('C:\myfiles\picture.gif=c:\myfiles\greatpic.gif');  

See also
DestFolder property;  
Copy, Move, Rename and Delete methods.