PDA

View Full Version : Code copy correction


FoxLeader
08-09-2007, 07:03 PM
Hello everyone,

I'm experiencing some problems with my code. The goal is to copy the folder contents from the hard drive (those already have the right subfolders) and to reconstruct them in the AutoPlay folder to be executed within the php server.
Here's the code I did, and I can't find why it doesn't work! I simply call it with "TransferToTest()"

function TransferToTest()
sDest_ = Dialog.FolderBrowse("Choisissez le répertoire du projet", UserDocs.."\\Portfolio Bon Melon");
StatusDlg.Show();
Folder.Create("AutoPlay\\Server\\www\\css");
Folder.Create("AutoPlay\\Server\\www\\images");
Folder.Create("AutoPlay\\Server\\www\\images\\portfolio");
Folder.Create("AutoPlay\\Server\\www\\js");
File.Copy(sDest_.."\\css\\*.*", "AutoPlay\\Server\\www\\css", true, true, false, true, nil);
File.Copy(sDest_.."\\images\\*.*","AutoPlay\\Server\\www\\images", true, true, false, true, nil);
File.Copy(sDest_.."\\images\\portfolio\\*.*","AutoPlay\\Server\\www\\images\\portfolio", true, true, false, true, nil);
File.Copy(sDest_.."\\js\\*.*","AutoPlay\\Server\\www\\js", true, true, false, true, nil);
File.Copy(sDest_.."\\*.*","AutoPlay\\Server\\www", true, true, false, true, nil);
StatusDlg.Hide();
Dialog.Message("Copie des fichiers", "Les fichiers ont été copiés avec succès!", MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1);
end

Thanks a lot!
FoxLeader

Edit: Is it me or the [code] balises were supposed to add color to the code?

FoxLeader
08-10-2007, 01:57 PM
Any ideas guys? (and girls !?!)

Eagle
08-10-2007, 07:45 PM
looking at the code:

you need to define the Full paths for Source and Destination actions
for each folder and file copy action

hth

FoxLeader
08-10-2007, 11:10 PM
So if I understand well, a relative path doesn't works? I would have to get the "_SourceFolder", instead of "AutoPlay\\Server" etc... !?!

I will try it when I'll be back. ;)