How come compiling .exe fails to....

Everything else that doesn't fall into one of the other PB categories.
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

How come compiling .exe fails to....

Post by SFSxOI »

Just noticed this with PB 5.10. If I compile some code to a .exe and then make changes to the code and compile again using the same .exe name (e.g. someapp.exe) into the same folder where the first compile .exe exists with the same name I do not get a warning or message asking if I want to replace the file. Instead, compile finishes as expected with no issues/warnings but when I look at the time stamp of the .exe (which should have been over written by the new compile) the time stamp has not changed. This means I can't simply look at the newer compiled .exe and determine if its newer so I don't know if the newer .exe actually compiled or not.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
User avatar
skywalk
Addict
Addict
Posts: 4316
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: How come compiling .exe fails to....

Post by skywalk »

It has been this way since at least v4.5.
I've gotten used to it and now prefer one less prompt.
If my exe/dll is approved, I move it out of the development folder so it cannot be overwritten. :wink:
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: How come compiling .exe fails to....

Post by SFSxOI »

It has? Guess I never noticed it before because I usually compile each compile into its own seperate 'generations' folder.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
PMV
Enthusiast
Enthusiast
Posts: 727
Joined: Sat Feb 24, 2007 3:15 pm
Location: Germany

Re: How come compiling .exe fails to....

Post by PMV »

If the compiler posts no errors, it should be ok.
If you prefer to have the timestamp updated,
post it as a feature request. :wink:

I have never looked at the timestamp of the exe. :lol:
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: How come compiling .exe fails to....

Post by SFSxOI »

I look at time stamps all the time. Its just part of my work to do so and has become second nature. Ya gotta look at every little thing when you do malware and botnet analysis for a living. However, what bought it to my attention this time was that I was doing a quick value change on a constant in some code for a small utility that had not been deployed yet for Windows 8. So this time I just opened up the source code, did the 10 second change, and compiled it in the same folder where the original .exe existed instead of creating a new folder for it. I looked at the time stamp of the file to get the log entry info I needed and thats when I realized the time stamp had not changed.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: How come compiling .exe fails to....

Post by IdeasVacuum »

...Just add a tool to the IDE that deletes the existing exe before the compiler writes a new one.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
fsw
Addict
Addict
Posts: 1603
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Re: How come compiling .exe fails to....

Post by fsw »

SFSxOI wrote:... compile finishes as expected with no issues/warnings but when I look at the time stamp of the .exe (which should have been over written by the new compile) the time stamp has not changed. This means I can't simply look at the newer compiled .exe and determine if its newer so I don't know if the newer .exe actually compiled or not.
The same happens on OSX...

I am to provide the public with beneficial shocks.
Alfred Hitshock
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: How come compiling .exe fails to....

Post by MachineCode »

SFSxOI wrote:when I look at the time stamp of the .exe (which should have been over written by the new compile) the time stamp has not changed
It's normal Windows behavior. You have to look at the MODIFIED stamp, not CREATED stamp. The same behavior happens if you create a Notepad file in Windows over an existing one, or indeed any other file over an existing one. Not a PureBasic bug.
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
luis
Addict
Addict
Posts: 3895
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: How come compiling .exe fails to....

Post by luis »

SFSxOI wrote:and compile again using the same .exe name (e.g. someapp.exe) into the same folder ... when I look at the time stamp of the .exe (which should have been over written by the new compile) the time stamp has not changed.
Using 510 x86 win7, selecting compile -> create executable here the timestamp changes. The one you see normally looking at a file inside a folder using windows explorer. I suppose you are referring to that one, not the creation time.
"Have you tried turning it off and on again ?"
SFSxOI
Addict
Addict
Posts: 2970
Joined: Sat Dec 31, 2005 5:24 pm
Location: Where ya would never look.....

Re: How come compiling .exe fails to....

Post by SFSxOI »

MachineCode wrote: It's normal Windows behavior. You have to look at the MODIFIED stamp, not CREATED stamp. The same behavior happens if you create a Notepad file in Windows over an existing one, or indeed any other file over an existing one. Not a PureBasic bug.
Hmmm, no its not normal Windows behavior. If it were normal windows behavior there would be a message warning/asking about overwriting/replacing an existing file of the same name in the same location.

The same behavior does not take place with notepad. You can check it yourself; If a notepad .txt file is created and saved, then notepad is closed then reopened and another .txt file created and saved in the same location with the same name as the previously created existing .txt file there will be a warning about overwriting the file. This doesn't happen in this case with compiling a .exe to the same location with the same name as an existing previously compiled .exe, there is no message and there should be.

So if PureBasic effectively supresses or prevents this warning by not changing something to do with time stamps or by another method or by not allowing the message then its not being windows compliant or compatable because the compliant compatable thing is to show a message when a file is overwritten/replaced in a case like this. It is windows compliant/compatable to allow the warning/asking message about overwriting/replacing any recognized file extension type (e.g. .exe, .dll, .txt, etc...) file of the same name in the same location being used from any session of an application unless supressed for specific legitimate purposes by legitimate methods (for example, silent install software).

In some ways this Purebasic behavior, by there not being a warning/asking message about overwriting/replacing, is malware like behavior. Not saying Purebasic is malware because its not malware, just noting that the PureBasic behavior in this aspect is the same basic behavior that may be seen with some malware (like some of the recent Java related malware exploits).

But I suppose asking or requesting that expected behavior (the prompt asking/warning about overwriting/replacing the file) be placed in or restored to PureBasic is useless. Its not a feature request because because its not a feature thing, its an expected normal windows compliant/compatable thing and asking that PureBasic be windows compliant/compatable in this respect is useless. Its not a bug because (maybe obviously) its by design (if it is by design, although not compliant/compatable for Windows). So there is nothing to request, however, this behavior should be noted in the help and any other documentation for PureBasic.
Last edited by SFSxOI on Sun Feb 24, 2013 4:57 pm, edited 5 times in total.
The advantage of a 64 bit operating system over a 32 bit operating system comes down to only being twice the headache.
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: How come compiling .exe fails to....

Post by MachineCode »

Sorry, I was talking about the timestamps after the same file was overwritten or re-created after confirmation. They do remain the same for file creation.

But, yes, the IDE could (make it optional!) ask the user if they want to overwrite the existing exe.

And now:
SFSxOI wrote:the time stamp has not changed. This means I can't simply look at the newer compiled .exe and determine if its newer so I don't know if the newer .exe actually compiled or not.
Yes you can: just look at the MODIFIED timestamp, as I said. It changes with every fresh exe creation, which was the point of my original reply. ;)
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
Post Reply