Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copy Only Files That Have Changed to Duplicate Drive
Message
 
To
10/08/2007 13:11:24
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
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:
01247602
Views:
22
Hi Dragan

>There should be some code on UT to convert the timestamp field into a datetime and vice versa - so you can get a timestamp number to compare against the field of the same name in the .pjx. Anything with a greater number was edited since.

Yes, I changed the code to use Files object and got to the datetime of the filenames, did a TTOC(...,1) and provided a similar string as a parameter to Naomi's function, this allowed me to compare the timestamps and get a list of changed files only.
LOCAL ldDate, ldTime
LOCAL ARRAY laZip[1]

ADIR(laZip, "c:\vso3\projects\c15.zip")

ldDate = laZip[1, 3]
ldTime = laZip[1, 4]

MakeList("c:\trashcan\temp.lst", DTOS(ldDate) + CHRTRAN(ldTime, ":", ""))

MODIFY COMMAND c:\trashcan\temp.lst


FUNCTION MakeList
        *** tcZipList - filename to create with the list of modified files
        *** tcDateToCheck - datetime in yyyymmddhhmmss
        LPARAMETERS tcZipList, tcDateToCheck

        LOCAL lnHandle

        lnHandle = FCREATE( (tcZipList))

        FOR EACH loFile IN _VFP.ACTIVEPROJECT.FILES
                IF TTOC(loFile.LASTMODIFIED, 1) > tcDateToCheck
                        lcFilePath = ADDBS( JUSTPATH( loFile.NAME))
                        lcFileName = JUSTSTEM( loFile.NAME)
                        lcFileExt  = UPPER(JUSTEXT( loFile.NAME))

                        DO CASE
                                CASE lcFileExt = "SCX"
                                        * forms
                                        FPUTS( lnHandle, loFile.NAME)
                                        FPUTS( lnHandle, lcFilePath+lcFileName+".SCT" )

                                CASE lcFileExt = "VCX"
                                        * classlibs
                                        FPUTS( lnHandle, loFile.NAME)
                                        FPUTS( lnHandle, lcFilePath+lcFileName+".VCT" )

                                CASE lcFileExt = "DBC"
                                        * databasecontainers
                                        FPUTS( lnHandle, loFile.NAME)
                                        FPUTS( lnHandle, lcFilePath+lcFileName+".DCT" )
                                        FPUTS( lnHandle, lcFilePath+lcFileName+".DCX" )

                                CASE lcFileExt = "FRX"
                                        * reports
                                        FPUTS( lnHandle, loFile.NAME)
                                        FPUTS( lnHandle, lcFilePath+lcFileName+".FRT" )

                                CASE lcFileExt = "LBX"
                                        *labels
                                        FPUTS( lnHandle, loFile.NAME)
                                        FPUTS( lnHandle, lcFilePath+lcFileName+".LBT" )

                                CASE lcFileExt = "DBF"
                                        * database tables
                                        FPUTS( lnHandle, loFile.NAME)

                                        IF FILE( lcFilePath+lcFileName+".CDX" )
                                                FPUTS( lnHandle, lcFilePath+lcFileName+".CDX")
                                        ENDIF

                                        IF FILE( lcFilePath+lcFileName+".FPT" )
                                                FPUTS( lnHandle, lcFilePath+lcFileName+".FPT")
                                        ENDIF

                                OTHERWISE
                                        * any other file in the project
                                        FPUTS( lnHandle, loFile.NAME)
                        ENDCASE
                ENDIF
        ENDFOR

        FCLOSE( lnHandle )
Hope it is useful to you Tracy.

Thanks.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Previous
Reply
Map
View

Click here to load this message in the networking platform