Hi my dear friends!
In reply to my question: How to copy folders to another location while adding the paths to a listbox? (ref. http://www.experts-exchange.com/......../Delphi/Q_22049426.html#17877306
) TName answered me and provided a brilliant piece of code which took care of my concern.
Now I want to modify it, here's what I would want:
Instead of selecting a folder, it should allow me to select a file. Instead of adding the folder reference to the listbox, it should add the file reference to the listbox. However,it should still copy the complete folder from where I selected the file.
So when I select d:\XXX\JJ\Vandaag zonder kleren\Jenna Jameson.jpg......this path should be added to my listbox while copying the entire directory d:\XXX\JJ\Vandaag zonder kleren\ to the new location where I copied the single file to.
Surely not all of this is abacadabra to me, but putting this whole thing back together...is.....I manage to select a file, add its reference to the listbox while copying the file as well. But how do I copy the entire directory where the file came from?
This is what I coded so far > b y using both the SelectDirectory and
the OpenDialog thing, I almost achieved my goal....
DirSelected, NewName: string;
case CheckBox1.Checked of
if SelectDirectory('Select a folder:', 'C:\', DirSelected) then begin
ShowMessage('No folder selected');
if OpenDialog1.Execute then begin
NewName := 'D:\Data\'+ExtractfileName
ShowMessage('No file selected');
ps working samples make me a happy man, if you need more info please ask!