FoxBin2Prg - OptimizeByFilestamp???

9 views
Skip to first unread message

Matt Slay

unread,
Nov 5, 2015, 12:10:56 PM11/5/15
to FoxPr...@googlegroups.com

What am I missing?

 

I want to tell FoxBin2Prg to only process files in the project if the timestamp appears to be newer than the last time the text file was generated:

 

OptimizeByFilestamp: 1

 

 

I uncommented this setting from the FoxBin2Prg.cfg file, but it still seems to process every file in the Project.

 

Here is how I call FoxBin2Prg:

 

    DO "H:\Work\util\Thor\Thor\Tools\Components\FoxBIN2PRG\FoxBin2Prg.prg" WITH (lcProject), '*'

 

 

 

 

 

 

 

****************************************************************************************************

* FOXBIN2PRG v1.19.40

* CONFIGURATION FILE / ARCHIVO DE CONFIGURACI�N

****************************************************************************************************

 

****************************************************************************************************

* SECTION DOCUMENTATION OF OPTIONS / SECCI�N DE DOCUMENTACI�N DE OPCIONES

*

* EN: Note: This values have precedence over internal parameters and parameters used on scripts

* ES: Nota: Estos valores tienen precedencia sobre los par�metros internos y los par�metros usados en los scripts

*

* DETAIL OF SUPPORTED VALUES / DETALLE DE VALORES SOPORTADOS

* If no values given, these are the DEFAULTS / Si no se proporcionan valores, estos son los PREDETERMINADOS

*

* extension: tx2=newext                                             && Default FoxBin2Prg extensions ends in '2' (see at the bottom) / Las extensiones por defecto de FoxBin2Prg terminan en '2' (ver debajo de todo)

* ShowProgressbar: 1                                    && 0=Don't show, 1=Allways show, 2= Show only for multi-file processing / 0=No mostrar, 1=Mostrar siempre, 2=Mostrar solamente para multi-procesamiento

* DontShowErrors: 0                                                      && Show message errors by default / Mostrar mensajes de error por defecto

* NoTimestamps: 1                                                         && Crear timespampt by default for minimize differences / Vaciar Timestamps por defecto para minimizar diferencias

* Debug: 0                                                                                          && Don't Activate individual <file>.Log by default / No Activar <archivo>.Log por defecto

* ExtraBackupLevels: 1                                  && By default 1 BAK is created. With this you can make more .N.BAK, or none / Por defecto 1 BAK es creado. Con esto puede crear m�s .N.BAK, o ninguno

* ClearUniqueID: 1                                                          && 0=Keep UniqueID, 1=Clear Unique ID. Useful for Diff and Merge / 0=Mantener UniqueID, 1=Borrar Unique ID. Util para Diff y Merge

* ClearDBFLastUpdate: 1                                              && 0=Keep DBF LastUpdate, 1=Clear DBF LastUpdate. Useful for Diff. / 0=Mantener DBF LastDate, , 1=Borrar DBF LastDate. Util para Diff.

OptimizeByFilestamp: 1                               && Optimize file regeneration depending on file timestamp / Optimizar la regeneraci�n de archivos dependiendo del timestamp de archivo

* AllowMultiConfig: 1                                     && 1=Allow CFG files per directory. if no CFG found, then use Main CFG. 0=Only use Main CFG

* DropNullCharsFromCode: 1                     && 1=Drop NULL chars from source code / 0=Leave Nulls in code, if any

* Language: (auto)                                                          && Language of shown messages and LOGs. EN=English, FR=French, ES=Espa�ol, DE=German, Not defined = AUTOMATIC [DEFAULT]

 

*-- CONVERTION OPTIONS / OPCIONES DE CONVERSI�N

* PJX_Conversion_Support: 2                    && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

* VCX_Conversion_Support: 2                   && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

* SCX_Conversion_Support: 2                   && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

* FRX_Conversion_Support: 2                   && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

* LBX_Conversion_Support: 2                    && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

* MNX_Conversion_Support: 2                 && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

* DBC_Conversion_Support: 2                   && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge)

DBF_Conversion_Support: 4                       && 0=No support, 1=Generate TXT only (Diff), 2=Generate TXT and BIN (Merge), 4=Generate TXT with DATA for DIFF (No Bidirectional!)

* >>DBF_Conversion_Support NOTE:     >> EN: FoxBin2Prg support bi-directional convertion of DBFs, but does not keep data. Use with care.

*                                                                                                                                             >> ES: FoxBin2Prg tiene soporte bi-direccional para convertir DBF, pero no mantiene los datos. Usar con cuidado.

* DBF_Conversion_Included: * && If DBF_Conversion_Support:4, you can specify mnultiple filemasks: www,fb2p_free.dbf / Si DBF_Conversion_Support:4, se pueden indicar m�ltiples m�scaras de archivo: www,fb2p_free.dbf

* DBF_Conversion_Excluded:    && If DBF_Conversion_Support:4, you can specify mnultiple filemasks: www,fb2p_free.dbf / Si DBF_Conversion_Support:4, se pueden indicar m�ltiples m�scaras de archivo: www,fb2p_free.dbf

 

*-- "CLASS PER FILE" OPTIONS (UseClassPerFile: 1) / OPCIONES DE "CLASE POR ARCHIVO" (UseClassPerFile: 1)

* UseClassPerFile: 0                                        && 0=One library tx2 file, 1=Multiple file.class.tx2 files / 0=Una archivo librer�a tx2, 1=M�ltiples archivo.clase.tx2

* RedirectClassPerFileToMain: 0               && 0=Don't redirect to file.tx2, 1=Redirect to file.tx2 when selecting file.class.tx2 / 0=No redireccionar a archivo.tx2, 1=Redireccionar a archivo.tx2 cuando se seleccione archivo.clase.tx2

* ClassPerFileCheck: 0                                   && 0=Don't check file.class.tx2 inclusion, 1=Check file.class.tx2 inclusion / 0=No verificar la inclusi�n de archivo.clase.tx2, 1=Verificar la inclusi�n de archivo.clase.tx2

*

* END DOCUMENTATION SECTION / FIN DE LA SECCI�N DE DOCUMENTACI�N

****************************************************************************************************

 

 

****************************************************************************************************

* YOU CAN MODIFY FROM HERE / PUEDE MODIFICAR DESDE AQU�

 

* EN: Uncomment for SourceSafe compatibility. You can change the extension on the right side.

* ES: Descomentar para compatibilidad con SourceSafe. Puede cambiar la extensi�n del lado derecho.

*---------------------------------------------------------------------------------------------------

*extension: pj2=pja

*extension: vc2=vca

*extension: sc2=sca

*extension: fr2=fra

*extension: lb2=lba

*extension: mn2=mna

*extension: db2=dba

*extension: dc2=dca

Fernando D. Bozzo

unread,
Nov 6, 2015, 4:38:32 AM11/6/15
to Thor, the Tool Manager for FoxPro
Hi Matt:

I've been checking this, and it is working ok. The latest config (foxbin2prg.cfg) have changed it's name from v1.19.42 (apr.16,2015) to foxbin2prg.cfg.txt to not ovewrite the client configuration.

So, default value for OptimizeByFilestamp is 0 from v1.19.25 (jun.25,2014) because depending on how you use FoxBin2Prg, you can loose your modifications.

In example, if you use FoxBin2Prg in the old way (as SccText used to) for 1 way convertion to text-only, then this setting is safe to use with "1" because you don't modify the generated tx2 files.

If you use 2-way convertion you can decide to modify the text file to regenerate the binary, but if you want to check something on your classlib or form and open it with MODIFY command, sometimes VFP automatically writes metadata to the VCX/SCX, which changes the file timestamp, making it appear as if was modified, so next time you regenerate the binary will not be regenerated because the file timestamp is newer than your modification on the text file (just a worst-case example), so you effectively loose your text changes.

Back to the issue, if you want to check this option in a test directory, follow this steps:

- Create a test directory (ie: c:\test)
- Copy your project into it
- Create a personal config file (c:\test\foxbin2prg.cfg) just to make sure no other configs can interfere in this directory
- Use these settings on it:
OptimizeByFilestamp: 1
Language: EN
Debug: 1
- Right-click your test directory (ie: c:\test), "Send To" FoxBin2Prg.exe and choose "Binary to Text" option

In this case, a file named "INTERACTIVE-SHOWMSG-BIN2PRG.LOG" is created in this directory explaining all the processed files and the decisions made.

In example, if I use OptimizeByFilestamp: 0, a log like this is generated (section cut):

> USING THIS SETTINGS: C:\TEST\FOXBIN2PRG.CFG  => C:\TEST\fb2p_test.vcx
    c_OriginalFileName:           C:\TEST\fb2p_test.vcx

    c_foxbin2prg.changefileattribute >> [C:\TEST\fb2p_test.VC2] lnRet = 1, dwFileAttributes_Orig = 32

    Converting file C:\TEST\fb2p_test.VC2...
        * Optimization: output file [C:\TEST\fb2p_test.VC2] was not overwritten because it is the same as was generated.



But if I use OptimizeByFilestamp: 1, a log like this is generated (section cut):

> USING THIS SETTINGS: C:\TEST\FOXBIN2PRG.CFG  => C:\TEST\fb2p_test.vcx
    c_OriginalFileName:           C:\TEST\fb2p_test.vcx

    c_foxbin2prg.changefileattribute >> [C:\TEST\fb2p_test.VC2] lnRet = 1, dwFileAttributes_Orig = 32

    Converting file C:\TEST\fb2p_test.VC2...
        * Optimization: output file [C:\TEST\fb2p_test.VC2] was not regenerated because it's filestamp is newer than the inputfile.


As you can see, changes the message becuase changes the internal logic:

- With OptimizeByFilestamp:0 there is another optimization in place, that compares the contents of the generated file with the existent file, and do not replace it if it is the same.

- With OptimizeByFilestamp:1 the file timestamp of the source file is compared with the target timestamp, and it is regenerated only if it is older than the input file timestamp.

Obviously, a recompilation of the binaries change their file timestamps, and this can change the expected results.

Calling FoxBin2Prg from the command line as you do, will work in the same way, and you can use debug:1 to make sure about the decisions made by FoxBin logic.

Fernando D. Bozzo

unread,
Nov 6, 2015, 4:41:45 AM11/6/15
to Thor, the Tool Manager for FoxPro
...I forgot to explain that foxbin2prg.cfg is the real config file and the renamed file foxbin2prg.cfg.txt is just for documentation purposes of the parameters, and for not ovewriting the client config every time I document some new value to this file, which is not common anymore.

Matt Slay

unread,
Nov 6, 2015, 7:08:50 AM11/6/15
to FoxPr...@googlegroups.com

Where does it look for the config file? In the direct where the FoxBin2Prg.prg file is located?

 

Or, since I pass a Project name to it, does it look for the config where in the folder where the Project is located?

 

 

 

    DO "H:\Work\util\Thor\Thor\Tools\Components\FoxBIN2PRG\FoxBin2Prg.prg" WITH (lcProject), '*'

 

 

 

 

--------------------------------------------

Matt Slay, President

Jordan Machine Co.

355 Clow Lane

PO Box 170339

Birmingham, AL 35217

Ph: 205-849-5050

Fx: 205-849-5075

matt...@jordanmachine.com

http://www.JordanMachine.com

--
You received this message because you are subscribed to the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this group and stop receiving emails from it, send an email to FoxProThor+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Fernando D. Bozzo

unread,
Nov 6, 2015, 8:09:46 AM11/6/15
to FoxPr...@googlegroups.com

Hi Matt:

The configuration file, as described in the VFPx help page, is searched 1st in FoxBin2Prg directory, and then it is searched hierarchically on the directory you do the conversion, inheriting the values of the configs found in each level.

If you use debug:1 in the final directory config, you can read inside the log file the exact settings that are inherited from each config and what config file changes what setting, at the beginning of the log.

You received this message because you are subscribed to a topic in the Google Groups "Thor, the Tool Manager for FoxPro" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/FoxProThor/istVJMpaKIk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to FoxProThor+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages