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:00:46
 
 
To
09/08/2007 12:31:16
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:
01247061
Views:
28
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...
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform