Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » Problematic hack in upp::Build.cpp
Problematic hack in upp::Build.cpp [message #41929] Fri, 07 February 2014 08:21 Go to next message
slashupp is currently offline  slashupp
Messages: 231
Registered: July 2009
Experienced Member
In Build.cpp there is the following code:

bool MakeBuild::Build(const Workspace& wspc, String mainparam, String outfile, bool clear_console)
{
	String hfile = outfile + ".xxx";
	SaveFile(hfile, "");
	FileTime start_time = GetFileTime(hfile); // Defensive way to get correct filetime of start
	DeleteFile(hfile);
	
	ClearErrorEditor();
	BeginBuilding(true, clear_console);
    ...


I use a background process to automatically backup changed files
in my project-dir (See: https://github.com/slashmais/simplebup)
and some of my workfiles happen to use the extension '.xxx'.

The above code caused an empty '.xxx' backup that had me
bug-hunting my code for hours..

I'm sure there are better ways to get the needed timestamp, or
at least create a proper temporary file without this kind of
clashing, this is not a good hack at all

(I've for now changed my extension to '.x_x' but it is only a
temporary work-around)


Re: Problematic hack in upp::Build.cpp [message #41962 is a reply to message #41929] Sat, 08 February 2014 22:13 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
slashupp wrote on Thu, 06 February 2014 23:21



(I've for now changed my extension to '.x_x' but it is only a
temporary work-around)




Sorry it took you so much time to find the problem.

Upp has used the .xxx extension for some time.
Since a single user has a conflict is not a viable solution for a change to the Upp core code.

You can use .x_x, .xyz, your initials, etc.
If you need more options to choose from just ask.

[Updated on: Sat, 08 February 2014 22:14]

Report message to a moderator

Re: Problematic hack in upp::Build.cpp [message #41964 is a reply to message #41962] Sun, 09 February 2014 05:46 Go to previous messageGo to next message
slashupp is currently offline  slashupp
Messages: 231
Registered: July 2009
Experienced Member
@nlneilson: touchy!? did you perhaps produce that heinous travesty? Smile

In idefile.cpp [305] and Util.cpp [54 & 59] the extension '.$tmp'
is already used.

A logical and _consistent_ continuation would be to use this
extension elsewhere as well, or if that will clash, to at least
use the '$' character _consistently_ to indicate upp-private
temporary files, e.g '.$xxx'.

Anyway, on Linux there is a /tmp directory for exactly these kind
of files, or for persistent discardable data /var/tmp is
available. To use them in this case would require a
'#ifdef PLATFORM_POSIX' ...?


Re: Problematic hack in upp::Build.cpp [message #41966 is a reply to message #41964] Sun, 09 February 2014 09:32 Go to previous message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
No I am not sharp enough to make much of a contribution to Upp.

The point I was trying to make is if a change needs to be made why do you expect the Upp code to be changed rather than you make the necessary changes in your code.
Previous Topic: BUG: "Close();" does not!
Next Topic: Fatal error invalid memory access
Goto Forum:
  


Current Time: Thu Jun 20 23:07:18 CEST 2024

Total time taken to generate the page: 0.01632 seconds