News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Batch file help

Started by jcfuller, January 28, 2013, 11:25:45 PM

Previous topic - Next topic

jcfuller


I know Steve and a number of others here do a lot of batch file work so a little help for this aging brain ?

This is the batch file I use to compile bc9

@setlocal
@echo off
@REM *******************************************************
@REM Uses bc.exe from c:\bcx\bin for first compile
@REM *******************************************************
@SET PATH=c:\bcxradasm3\bcx\bin;%PATH%
@SET MINGW=C:\Mingwtdm64
@IF EXIST bc9.cpp del bc9.cpp
@IF EXIST bc9.exe del bc9.exe
@ECHO create new 32bit  version of bc9 using MinGWTDM64
@copy source\bc9.bas /Y
@copy source\bc9.rc  /Y

@ECHO Translate bas to cpp using original bc9
bc bc9 -c -ne
@ECHO Compile cpp file
CALL GWGPP bc9 -m32 con -L/pcre-8.32/.libs -lpcrecpp -lpcre -I/pcre-8.32 -DPCRE_STATIC 2> info1.txt


@ECHO Translate bc9 with first generation offspring
bc9 bc9 -c -ne
CALL GWGPP bc9 -m32 con -L/pcre-8.32/.libs -lpcrecpp -lpcre -I/pcre-8.32 -DPCRE_STATIC 2> info2.txt

@ECHO Translate bc9 with second generation offspring
bc9 bc9 -c -ne

CALL GWGPP bc9 -m32 con -L/pcre-8.32/.libs -lpcrecpp -lpcre -I/pcre-8.32 -DPCRE_STATIC 2> info3.txt


IF NOT EXIST out MD out
copy bc9.bas out\bc9.bas
copy bc9.cpp out\bc9.cpp
del out\bc9.exe
copy bc9.exe out\bc9.exe
del c:\bcxradasm3\bcx\bin\bc9.exe
copy bc9.exe c:\bcxradasm3\bcx\bin\bc9.exe
copy Bcx_License.Htm out\Bcx_License.Htm
:done
@ECHO ALL DONE


Every think works fine except the creation date (when viewed with windows explorer) on the copied bc9.exe shows the original
date the file was copied/created to the out and c:\bcxradasm3\bcx\bin\ directories?
The creation date of the file to be copied shows the date and time of the new creation.
I just added the del to see if that would work and it didn't.

How can I have the same creation date and time on the copies as the original.
Thanks

James

dedndave

that is a good one   :P
i have noticed that when assembling files, sometimes

one thing i would do is to rename the files to bc, bc1, bc2, etc
then, delete/rename at the end to straighten things out
when you execute lines like this
bc9 bc9 -c -ne
there may be some confusion
i am not even sure that line is being executed

as for the date/time stamp
it may well be that the newly created file has an updated timestamp,
but the NTFS buffers don't flush and update - so the old timestamp is still visible

you may have to write an app that sets the creation date and time just to test that theory   :P

jcfuller

Dave,

bc9 bc9 -c -ne

works fine as the first bc9 is an exe looking for bc9.bas

The thing that is bafflig is the original newly created file has the correct time/date stamp but when copied to the other directories it does nt.
James

dedndave

but - doesn't it want to crank out a bc9.exe, at some point ?

jcfuller

Quote from: dedndave on January 29, 2013, 01:42:16 AM
but - doesn't it want to crank out a bc9.exe, at some point ?

Because bc9 is written in itself it needs 3 compiles before any errors manifest themselves.
bc9.exe translates bc9.bas to bc9.cpp
the batch file GWGPP compiles the bc9.cpp to a new bc9.exe

James



Tedd

If you make a copy of a file, then you're creating a new file with the same content - so there will be a new creation time, however the modification time will still be the same as the original.

For build issues that this sometimes causes, there's a tool named 'touch' that will allow you to update or modify the times of files. Or you can make a simple version yourself using the Get/SetFileTime functions.
Potato2

jcfuller

Quote from: Tedd on January 29, 2013, 02:58:51 AM
If you make a copy of a file, then you're creating a new file with the same content - so there will be a new creation time, however the modification time will still be the same as the original.

For build issues that this sometimes causes, there's a tool named 'touch' that will allow you to update or modify the times of files. Or you can make a simple version yourself using the Get/SetFileTime functions.

Sorry Ted that's not what I'm seeing. I'm getting the original creation time when the file was first copied into the out directory ‎(Tuesday, ‎March ‎20, ‎2012, ‏‎12:45:49 PM)  with a new modification time which is the same as the source.

James

dedndave

try rebooting (or maybe log off/log on) and see if it changes

Magnum

Here is a small batch 'Touch' program.

COPY /B c:\masm32\source\bak.bat +,,
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

KeepingRealBusy

Quote from: Tedd on January 29, 2013, 02:58:51 AM
If you make a copy of a file, then you're creating a new file with the same content - so there will be a new creation time, however the modification time will still be the same as the original.

For build issues that this sometimes causes, there's a tool named 'touch' that will allow you to update or modify the times of files. Or you can make a simple version yourself using the Get/SetFileTime functions.

What OS are you running? I think that XP Explorer used to retain the same dates/times when it copied. It seems that Win7 does not.

Dave.

jcfuller

Still a no go.
OS -> Win7 64
I did not reboot. I have been copying since march of last year and shut down the computer every night so .......

James

jcfuller

Well I think I figured this out and it's a Windows Explorer viewing thingy.
I am primarily interested in the last modification of a file anyway so in Windows Explorer I right clicked the description bar and up pops a list of items to view (yeah I know duh!). I added Date Modified and removed Date Created (which most of the time was the original date when a file with this name was created, not the actual file which had been deleted and recreated.
If I then added Date Created back it would show the correct new creation date.

James

KeepingRealBusy

Quote from: jcfuller on January 28, 2013, 11:25:45 PM

I know Steve and a number of others here do a lot of batch file work so a little help for this aging brain ?

This is the batch file I use to compile bc9

@setlocal
@echo off
@REM *******************************************************
@REM Uses bc.exe from c:\bcx\bin for first compile
@REM *******************************************************
@SET PATH=c:\bcxradasm3\bcx\bin;%PATH%
@SET MINGW=C:\Mingwtdm64
@IF EXIST bc9.cpp del bc9.cpp
@IF EXIST bc9.exe del bc9.exe
@ECHO create new 32bit  version of bc9 using MinGWTDM64
@copy source\bc9.bas /Y
@copy source\bc9.rc  /Y

@ECHO Translate bas to cpp using original bc9
bc bc9 -c -ne
@ECHO Compile cpp file
CALL GWGPP bc9 -m32 con -L/pcre-8.32/.libs -lpcrecpp -lpcre -I/pcre-8.32 -DPCRE_STATIC 2> info1.txt


@ECHO Translate bc9 with first generation offspring
bc9 bc9 -c -ne
CALL GWGPP bc9 -m32 con -L/pcre-8.32/.libs -lpcrecpp -lpcre -I/pcre-8.32 -DPCRE_STATIC 2> info2.txt

@ECHO Translate bc9 with second generation offspring
bc9 bc9 -c -ne

CALL GWGPP bc9 -m32 con -L/pcre-8.32/.libs -lpcrecpp -lpcre -I/pcre-8.32 -DPCRE_STATIC 2> info3.txt


IF NOT EXIST out MD out
copy bc9.bas out\bc9.bas
copy bc9.cpp out\bc9.cpp
del out\bc9.exe
copy bc9.exe out\bc9.exe
del c:\bcxradasm3\bcx\bin\bc9.exe
copy bc9.exe c:\bcxradasm3\bcx\bin\bc9.exe
copy Bcx_License.Htm out\Bcx_License.Htm
:done
@ECHO ALL DONE


Every think works fine except the creation date (when viewed with windows explorer) on the copied bc9.exe shows the original
date the file was copied/created to the out and c:\bcxradasm3\bcx\bin\ directories?
The creation date of the file to be copied shows the date and time of the new creation.
I just added the del to see if that would work and it didn't.

How can I have the same creation date and time on the copies as the original.
Thanks

James

What Windows release? I believe that Explorer in XP would retain the original file's creation date and time and use it as the creation date/time for the "COPY", thus both files looked the same. This does not seem to work the same way in Win 7.
Dave

jcfuller

Quote from: KeepingRealBusy on March 08, 2013, 09:26:14 AM
What Windows release? I believe that Explorer in XP would retain the original file's creation date and time and use it as the creation date/time for the "COPY", thus both files looked the same. This does not seem to work the same way in Win 7.
Dave

See Reply 10.

James