From: Robb B. <Rob...@gm...> - 2004-11-12 18:41:09
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Benjamin Riefenstahl schrieb: <blockquote cite="mid...@se..." type="cite"> <pre wrap="">Hi Robb, </pre> </blockquote> Hi!<br> <blockquote cite="mid...@se..." type="cite"> <pre wrap="">"Robb Bean" writes: </pre> <blockquote type="cite"> <pre wrap="">? I only know the path of a file (as command line argument) and extract the current directories name out of it. </pre> </blockquote> <pre wrap=""><!---->Yes. And my implied question was "Why do you need to do that?" Or rather, "I doubt there is any pressing need to do that, in my own programs I just use the file names that I get as-is in 99.9999 % of the cases." </pre> </blockquote> The reason is that the program needs information from other (configuration) files that are (per convention) in the same directory as the file to edit. So I thought that I could chdir into this directory and work only with the filenames without any additional directory name in front of it.<br> <blockquote cite="mid...@se..." type="cite"> <pre wrap="">The only common reason to fiddle with file names is when you are dealing with directories as parameters and you are recursing into them to treat them as a whole, so you need to splice together the individual file names. The only reasons to use chdir() (off the top of my head) are if you are a user shell or a network service. None of these situations seem to apply here. </pre> </blockquote> Makes a lot of sence so far. My former idea was saving complexity (in C) withoug prepending the directory to every filename since this a lot of memory handling in C. And I did not want to rewrite the whole program in C++ because it did work (but it was specific for a certain data format).<br> <blockquote cite="mid...@se..." type="cite"> <blockquote type="cite"> <pre wrap="">I will check this, and it is really possible that there is somewhere a bad pointer </pre> </blockquote> <pre wrap=""><!---->No. It's a *fact* that there is a bad pointer. That is what the error message is saying, just with more details. The question that is left is, which code in particular is responsible for it. </pre> </blockquote> Is it possible that the pointer is located somewhere in the triangle between user code, MinGW and the C runtime?<br> <blockquote cite="mid...@se..." type="cite"> <blockquote type="cite"> <pre wrap="">But how could this old C code affect my new C++ (Pathname class) code, because the C kernel is invoked after the C++ work (working with the path, ...) is done? </pre> </blockquote> <pre wrap=""><!---->What you describe is indeed unlikely. But until you have reproduced the error in a simple test case, we won't know what actually happens. </pre> </blockquote> That is my problem: I can not reproduce the error, even on my Mac that has a better memory handling than Intels have. But I will send the customer DrMinGW and they should tell me what happens.<br> <blockquote cite="mid...@se..." type="cite"> <pre wrap="">benny </pre> </blockquote> Yours,<br> <pre class="moz-signature" cols="72">-- Robert Bienert <robertbienert[AT]gmx[dot]net> <a class="moz-txt-link-freetext" href="http://www.rbprogs.de.vu/">http://www.rbprogs.de.vu/</a> - some free and open source stuff <a class="moz-txt-link-freetext" href="http://applaunch.sf.net/">http://applaunch.sf.net/</a> - a graphical command line for MacOS X <a class="moz-txt-link-freetext" href="http://www.robertbienert.de/">http://www.robertbienert.de/</a> - my personal homepage</pre> </body> </html> |