Chimaera Posted May 23, 2013 Share Posted May 23, 2013 Hi been messing with this for a while and im stuck I have a folder called Test Files Within that folder is a folder called Music Test What im trying to do is move the contents of the Test Files Directory whether they be files or folders to a sub directory to be created within the Test Files Directory called Upload The only way i have managed it so far is by copying them to @TempDir and back into Upload using DirCopy, but the problem is some of the files could be 8GB + so a long copy progress on slow machines is a no no It seems to resist being moved within itself Any suggestions please? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted May 23, 2013 Share Posted May 23, 2013 Show your code. I don't understand your problem. operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted May 23, 2013 Author Share Posted May 23, 2013 (edited) Simply this $sSetDefault = "E:\Code\Projects\Test Files" DirCopy($sSetDefault , $sSetDefault & "\Upload", 1) But the copy fails because im trying to copy within itself So how to copy the contents of $sSetDefault then create the folder Upload and move them to $sSetDefault & "Upload" I tried using RecFileListToArray but it leaves any folders behind and only copies the files Edited May 23, 2013 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted May 23, 2013 Share Posted May 23, 2013 (edited) You are trying to copy the root directory and place it inside itself. That's never going to work. I imagine you want all files and folders within Test Files placing inside a new folder (Upload - which will be created in the process) within Test Files. Edited May 23, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted May 23, 2013 Author Share Posted May 23, 2013 (edited) Yes exactly that, thats why im having the problem TestFiles* To TestFilesUpload But i cant copy upto 25gig to the temp and back again it would take forever on a slow system Im not exactly sure while RecFileListToArray leaves the original folders behind... edit prob cos im using FileMove Do i have to do a DirMove intead? Local $FindNfo = _RecFileListToArray($sSetDefault, "*", 0, 1) ;~ _ArrayDisplay($FindNfo, ".Nfo Files") If IsArray($FindNfo) Then For $i = 1 To $FindNfo[0] FileMove($sSetDefault & "\" & $FindNfo[$i], $sSetDefault & "\Upload\", 9) ;~ Sleep(100) Next Sleep(100) EndIf Edit 2 I tried DirMove and it deleted all the files and folders within TestFiles Edited May 23, 2013 by Chimaera If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
KaFu Posted May 23, 2013 Share Posted May 23, 2013 Maybe this is related: OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Solution czardas Posted May 23, 2013 Solution Share Posted May 23, 2013 (edited) #include <File.au3> Local $sDir = @ScriptDir & "\Test Files" Local $sNewFolder = $sDir & "\Upload" Local $aFiles = _FileListToArray($sDir, "*", 1) Local $aFolders = _FileListToArray($sDir, "*", 2) For $i = 1 To $aFiles[0] FileMove($sDir & "\" & $aFiles[$i], $sNewFolder & "\" & StringReplace($aFiles[$i], $sDir, ""), 8) Next For $i = 1 To $aFolders[0] DirMove($sDir & "\" & $aFolders[$i], $sNewFolder & "\" & StringReplace($aFolders[$i], $sDir, "")) Next Just replace @ScriptDir with E:CodeProjects Edited May 23, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Chimaera Posted May 23, 2013 Author Share Posted May 23, 2013 Thx guys @Kafu i tried that suggestions but it took 30+ secs to copy 1.8Gig @czardus that seems to do the ticket and very quickly just a couple of secs Thanks for the help czardas 1 If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
czardas Posted May 23, 2013 Share Posted May 23, 2013 (edited) Thanks Chimaera. I missed checking that the arrays are created with _FilelistToArray. You should add error checking in case there are no files or folders found.. Edited May 23, 2013 by czardas operator64 ArrayWorkshop Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now