Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy Only Files That Have Changed to Duplicate Drive
Message
 
 
À
09/08/2007 09:42:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01246997
Message ID:
01247004
Vues:
26
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...
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform