Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Only Files That Have Changed to Duplicate Drive
Message
From
09/08/2007 13:21:30
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01246997
Message ID:
01247075
Views:
34
True, I can also code a recursive file listing and check the modified dates and then check for associated files and copy those as well (using api file copy or other means as well). However, I was thinking that someone had already done this and I wasn't going to reinvent the wheel unless necessary :o)


>You can run XCOPY where you copy the file names that are copied to a file and then you could check for your "multi-part" files as needed and add the other part to a secondary copy operation.
>
>>Hi Fred, see my bold text...
>>
>>
>>
>>>Something wrong with good 'ol XCOPY using the /M switch? It only copies files that have the archive bit set and then it resets it so it won't get copied next time unless it changes and the archive bit is set again.
>>>
>>>
>>>>Hi Naomi,
>>>>
>>>>I actually have code to copy one entire project to another directory path, but that is not what I want to do. I want to copy a directory structure (many files in the structure are not in the project) but only those files that have been changed since the last copy and if one file in a set has changed (e.g. the .sct) then copy the others (.scx)...
>>>>
>>>>
>>>>
>>>>>Hi Tracy,
>>>>>
>>>>>I have something, which may be a starting point, if you don't want to follow Alex suggestion (BTW, should I say Alex's - looked strange to me):
>>>>>
>>>>>
>>>>>FUNCTION makelist
>>>>>LPARAMETERS tcZipList
>>>>>LOCAL lnHandle, loProject
>>>>>
>>>>>loProject = _vfp.ActiveProject
>>>>>lnHandle = FCREATE( (tcZipList))
>>>>>
>>>>>FOR lnI = 1 TO loProject.FILES.COUNT
>>>>>   lcFilePath = ADDBS( JUSTPATH( loProject.FILES[lnI].NAME))
>>>>>   lcFileName = JUSTSTEM( loProject.FILES[lnI].NAME)
>>>>>   lcFileExt  = UPPER(JUSTEXT( loProject.FILES[lnI].NAME))
>>>>>   DO CASE
>>>>>         * forms
>>>>>      CASE lcFileExt = "SCX"
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>         FPUTS( lnHandle, lcFilePath+lcFileName+".SCT" )
>>>>>         * classlibs
>>>>>      CASE lcFileExt = "VCX"
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>         FPUTS( lnHandle, lcFilePath+lcFileName+".VCT" )
>>>>>
>>>>>         * databasecontainers
>>>>>      CASE lcFileExt = "DBC"
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>         FPUTS( lnHandle, lcFilePath+lcFileName+".DCT" )
>>>>>         FPUTS( lnHandle, lcFilePath+lcFileName+".DCX" )
>>>>>
>>>>>         * reports
>>>>>      CASE lcFileExt = "FRX"
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>         FPUTS( lnHandle, lcFilePath+lcFileName+".FRT" )
>>>>>
>>>>>         *labels
>>>>>      CASE lcFileExt = "LBX"
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>         FPUTS( lnHandle, lcFilePath+lcFileName+".LBT" )
>>>>>
>>>>>         * database tables
>>>>>      CASE lcFileExt = "DBF"
>>>>>         *
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>         *
>>>>>         IF FILE( lcFilePath+lcFileName+".CDX" )
>>>>>            FPUTS( lnHandle, lcFilePath+lcFileName+".CDX")
>>>>>         ENDIF
>>>>>         *
>>>>>         IF FILE( lcFilePath+lcFileName+".FPT" )
>>>>>            FPUTS( lnHandle, lcFilePath+lcFileName+".FPT")
>>>>>         ENDIF
>>>>>
>>>>>         * any other file in the project
>>>>>      OTHERWISE
>>>>>         FPUTS( lnHandle, loProject.FILES[lnI].NAME)
>>>>>   ENDCASE
>>>>>
>>>>>ENDFOR
>>>>>FCLOSE( lnHandle )
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Has anyone already written anything which copies a directory structure but only copies those files that have changed? I have a utility that does that, but I want to do something specific to VFP files. For example, if the file is part of a form and either the .sct or .scx have changed, I want to copy both the .sct and .scx. The same for reports and classes, et al.
>>>>>>
>>>>>>I have another workstation with a mapped drive letter that I need to have a copy of a directory and its subdirectories on. I don't want to copy every file in the entire directory though if not necessary.
>>>>>>
>>>>>>I could write something, but I think it has already been done...
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform