Jump to content

Dosya Koplayama


kaan_karabey
 Share

Recommended Posts

Arkadaşlar Bir Ara Sanki Milano88 veya Başka Biri Şu an Tam Hatırlayamadım Bir Dosya Kopyalama Function u Paylaşmıştı Ama Şu An

 

Bulamıyorum.O Functionla Dosyanın İçindeki Dosyalarda Kopyalanıyordu.Ricam Etsem Elinde Olan Varsa Paylaşabilir mi?

Edited by kaan_karabey
Link to comment
Share on other sites

function CopyFolder(sFolder, sDestination, Callback)
if(String.ReverseFind(sFolder, "\\", false)==String.Length(sFolder))then sFolder = String.Mid(sFolder, 1, String.Length(sFolder)-1);end
if(String.ReverseFind(sDestination, "\\", false)~=String.Length(sDestination))then sDestination = sDestination.."\\";end
local foldername = String.SplitPath(sFolder).Filename
if(Folder.DoesExist(sFolder))and(Folder.DoesExist( sDestination))then
Folder.Create(sDestination.."\\"..foldername);
if(type(Callback)~="function")then Callback = nil;end
File.Copy(sFolder.."\\*.*", sDestination.."\\"..foldername, true, true, false, true, Callback);
end
end

Kullanım :

local sFold = Dialog.FolderBrowse("Select a folder to copy", "");
if(sFold~="CANCEL")then
local sDest = Dialog.FolderBrowse("Select a destination", "");
if(sDest~="CANCEL")then
CopyFolder(sFold, sDest, function(Source,Destination,Copied,Total,FileCopied,FileTotal)
local percent = string.format("%2d", 100*(Copied/Total));
Progress.SetRange("Progress1", 0, 100);
Progress.SetCurrentPos("Progress1", percent);
Progress.SetText("Progress1", "% " .. percent);
return true;
end)
end
end

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...