tazdev Posted January 27, 2005 Posted January 27, 2005 I searched and could not find anything on this so here goes, I am trying to copy filetypes a, b, and c from various directories under one root. In that directory are those 3 types as well as 5 or more others. Filecopy will copy the file over ONLY if the directory exists. DirCopy will copy the files and the structure however it copies all 8 or more types. (No filtering) Can DirCopy be used with filtering? I have an idea I am working on that will basically take the file name with full path, strip the name off, use DIRCreate to make the directory and then copy the file over. I am just asking to see if there is something already made in AutoIT that I overlooked.
Blue_Drache Posted January 27, 2005 Posted January 27, 2005 I searched and could not find anything on this so here goes,I am trying to copy filetypes a, b, and c from various directories under one root. In that directory are those 3 types as well as 5 or more others. Filecopy will copy the file over ONLY if the directory exists. DirCopy will copy the files and the structure however it copies all 8 or more types. (No filtering)Can DirCopy be used with filtering?I have an idea I am working on that will basically take the file name with full path, strip the name off, use DIRCreate to make the directory and then copy the file over. I am just asking to see if there is something already made in AutoIT that I overlooked.<{POST_SNAPBACK}>I say go for it. Even if it IS already made, then the worst that could happen is a mild flame from Valik. Either way, you come out ahead, becasue you've learned something. Besides, try looking at the "file.au3" include...just in case. Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache
tazdev Posted January 27, 2005 Author Posted January 27, 2005 _FileCreate( $sFilePath )Hmmmmmmmm;===============================================================================;; Description: Creates or zero's out the length of the file specified.; Syntax: _FileCreate( $sFilePath ); Parameter(s): $sFilePath - Path and filename of the file to be created; Requirement(s): None; Return Value(s): On Success - Returns 1; On Failure - Returns 0 and sets:; @error = 1: Error opening specified file; @error = 2: File could not be written to; Author(s): Brian Keene <brian_keene@yahoo.com>; Note(s): None;;===============================================================================
tazdev Posted January 27, 2005 Author Posted January 27, 2005 Nope didn't work.Here is what I tried:$line = filename with full path (read from a text file generated by DIR)$servermydocs = The backup folder path$filename = the filename and path up to the root Like 12345.xls is the file and it is in c:\documents and settings\<profile>\my documents\test\test2\12345.xls will have \test\test2\12345.xls_FileCreate($servermydocs&$filename)FileCopy($line, $servermydocs&$filename, 1)I had hoped that the above two lines will make the folder and a blank file, then the next line will copy the actual file over. Never made a file.
buzz44 Posted January 28, 2005 Posted January 28, 2005 (edited) is this GUI or none GUI ? i made a filecopy thing in GUI and i think i posted it in one of ur posts already but cant remember . to filter certain files.. u have to use this . this will copy all files FileCopy ( blahsource\*.*, blahdestination) this will only copy .bmp's FileCopy ( blahsource\*.bmp, blahdestination) i done a similiar project in VB .. but in autoit i think if u want to copy more than one file pattern u have to use a ; FileCopy ( blahsource\*.bmp;*.jpeg, blahdestination) im havent testing so hope that helps edit. just tested ... u cant do multiple patterns maybe im wrong but i guess you'll have to use to seperate filecopy's FileCopy ( blahsource\*.bmp, blahdestination) FileCopy ( blahsource\*.jpeg, blahdestination) Edited January 28, 2005 by burrup qq
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