well-knownQ8 Posted March 11, 2006 Share Posted March 11, 2006 Hi 1st of all, i'm very pleased for joining autoit forums, and want to thank the brilliant team that made this great scripting language and i have this question... Which is better (in performance) for renamining ... using FileMove() or the dos command "ren" ? ====== Thanks in Advance Link to comment Share on other sites More sharing options...
nfwu Posted March 11, 2006 Share Posted March 11, 2006 I think FileMove, because calling: Run("ren"&$whatever) in a script runs a new application and is slower. #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
well-knownQ8 Posted March 11, 2006 Author Share Posted March 11, 2006 I think FileMove, because calling:Run("ren"&$whatever)in a script runs a new application and is slower.thnx for the reply mmmm.....maybe.but what about the function FileMove itself !!isn't it uses two functions (moving then renaming) !? Link to comment Share on other sites More sharing options...
Lord_Doominik Posted March 11, 2006 Share Posted March 11, 2006 hm, i would use FIleMove()... as far as i know it's not a dos function and so it should be faster... and as far as i know it use just 1 function, for renaming while moving . Link to comment Share on other sites More sharing options...
ChrisL Posted March 11, 2006 Share Posted March 11, 2006 Hi 1st of all, i'm very pleased for joining autoit forums, and want to thank the brilliant team that made this great scripting language and i have this question...Which is better (in performance) for renamining ... using FileMove() or the dos command "ren" ?======Thanks in Advance I'd be supprised if there was much difference [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
well-knownQ8 Posted March 12, 2006 Author Share Posted March 12, 2006 I'd be supprised if there was much differenceI think there is a diffrence...and i've tried searching about FileMove's code, but i didn't fine any !...i'm thinking about making a simple test, to see that, thought... Link to comment Share on other sites More sharing options...
Lord_Doominik Posted March 12, 2006 Share Posted March 12, 2006 hm, you could take you the time and test which is faster, but i think it don't matters much... if one is faster then just a few 1/1000 seconds Link to comment Share on other sites More sharing options...
well-knownQ8 Posted March 15, 2006 Author Share Posted March 15, 2006 hm, you could take you the time and test which is faster, but i think it don't matters much... if one is faster then just a few 1/1000 secondsSorry.. I doubt it !!!Guys... You'll not beleive the results.. !!!!wait till next post Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 15, 2006 Moderators Share Posted March 15, 2006 Well the fact that you said that makes me think the DOS commands are better... hope you provide a good example! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nfwu Posted March 15, 2006 Share Posted March 15, 2006 I have an idea... i transfer a 1GB file from my ultra-slow 250GB External Drive to my harddrive using both methods! Wait up for the results! #) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
well-knownQ8 Posted March 15, 2006 Author Share Posted March 15, 2006 (edited) I have an idea... i transfer a 1GB file from my ultra-slow 250GB External Drive to my harddrive using both methods!Wait up for the results!#) --------------and now the results....first, i was preparing a table for running from 1000 to 100,000but from the begining the winner appears..for "Ren" Command (1,000 files)I ran it 4 times and the average was 57 seconds !!!For FileMove Function it took 3.2 Seconds in average !!!what a score... any comments ? Edited March 15, 2006 by well-knownQ8 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted March 15, 2006 Moderators Share Posted March 15, 2006 --------------and now the results....first, i was preparing a table for running from 1000 to 100,000but from the begining the winner appears..for "Ren" Command (1,000 files)I ran it 4 times and the average was 57 seconds !!!For FileMove Function it took 3.2 Seconds in average !!!what a score... any comments ? Care to provide the code that you used? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
nfwu Posted March 15, 2006 Share Posted March 15, 2006 (edited) oh yar, i used the move command.EDIT: ren command only allows rename within the current directory... so i had to use move...My code:#cs File: myp_maya7ple_en_win.exe Maya7 PLE Installation File =========== Type: Application Discription: myp_maya7ple_en_win =========== Location: C:\Documents and Settings\Owner\Desktop\Alex\ExeAndZip\InstallationExes Size: 261 MB (274,455,619 bytes) Size On Disk: 261 MB (274,456,576 bytes) =========== Created: Tuesday, October 25, 2005, 5:43:32 PM Modified: Tuesday, October 25, 2005, 5:42:10 PM Accessed: Today, March 15, 2006, 5:30:38 PM ========== All times are +8 GMT. #ce $from = '"C:\Documents and Settings\Owner\Desktop\Alex\ExeAndZip\InstallationExes\Copy (2) of myp_maya7ple_en_win.exe"' $to = '"J:\test_1.exe"' $from2 = 'C:\Documents and Settings\Owner\Desktop\Alex\ExeAndZip\InstallationExes\Copy (3) of myp_maya7ple_en_win.exe' $to2 = 'J:\test_2.exe' PluginOpen("J:\Alex\Programming\autoit scrips and scraps\Au3Console\Au3Console\Au3Console.dll") ConsoleLoad("TEST CONSOLE") Sleep(5000);; Wait for AutoIt to get ready... ConsolePrint("Starting DOS move command..."&@CRLF) $time = TimerInit() RunWait(@ComSpec & ' /c move '&$from&' '&$to, '', @SW_HIDE) ConsolePrint(TimerDiff($time)&": Time for DOS move command..."&@CRLF) Sleep(10000);;Wait for Windows to clear my drive's catche ConsolePrint("Starting AutoIt FileMove command..."&@CRLF) $time = TimerInit() FileMove($from2, $to2) ConsolePrint(TimerDiff($time)&": Time for AutoIt FileMove command..."&@CRLF) MsgBox(0,"", "Test Complete.") Edited March 15, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
well-knownQ8 Posted March 15, 2006 Author Share Posted March 15, 2006 Care to provide the code that you used?ok first copying 1000 file from the file test.txt For $i=0 To 1000 FileCopy("E:\Test\Renaming\test.txt","E:\Test\Renaming\test"&$i&".txt") Next Then $path = "E:\Test\Renaming" For $i=0 To 1000 ;~ FileMove($path & "\ren_to"&$i&".txt", $path& "\test"&$i&".txt") Run(@ComSpec & " /c " & 'ren '& """"&$path & "\test" & $i & ".txt""" & _ " "& "ren_to"&$i&".txt","",@SW_HIDE) Next running it once for Filemove, then once for Ren. as u can see this is a case for renaming file after file, (normal N times Loop). Link to comment Share on other sites More sharing options...
nfwu Posted March 15, 2006 Share Posted March 15, 2006 (edited) ok first copying 1000 file from the file test.txt For $i=0 To 1000 FileCopy("E:\Test\Renaming\test.txt","E:\Test\Renaming\test"&$i&".txt") Next Then $path = "E:\Test\Renaming" For $i=0 To 1000 ;~ FileMove($path & "\ren_to"&$i&".txt", $path& "\test"&$i&".txt") Run(@ComSpec & " /c " & 'ren '& """"&$path & "\test" & $i & ".txt""" & _ " "& "ren_to"&$i&".txt","",@SW_HIDE) Next running it once for Filemove, then once for Ren. as u can see this is a case for renaming file after file, (normal N times Loop). Maybe the slowdown was caused be too many concatenations? #) EDIT: PS. I sort of regret doing that copy maya installation thing... need 2 restart my com... accessing J: drive is just taking too long! Edited March 15, 2006 by nfwu TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
well-knownQ8 Posted March 15, 2006 Author Share Posted March 15, 2006 Maybe the slowdown was caused be too many concatenations?we don't know.but also in ur case (Moving), the results are very interesting...so "move" (dos command) is way better than "FileMove" Function !great 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