Recapping scattered comments.
After EACH method call IMMEDIATELY check the return value.
if the return value is not zero then IMMEDIATELY call errno. Do NOT make any other API calls before calling errno.
So you code should look like the following (with the included suggestion of strerror
int ret = rename(...);
if (ret != 0)
// Do NOT put other API calls here!
int errNum = errno;
// At this point you can make other API calls.
printf("Failed to rename %s", strerror(errNum));
I just found that I had fopen()'ed the same file twice without fclose()'ing it between. The offending rename(,)'s now work OK. I am sorry to take up so much of your time.
I just now inserted into my program this instruction:-
to rename a file which I had just created and the program never opens it. And the rename went OK.
The file that I was trying to rename it before :: I had fopen()'ed it in read mode, and read from it, and then fclose()'ed it; after that I tried to rename it, and that rename was refused.
Hello, first of all I have to apologise if my question is stupid or asked in the wrong place.
I'm rather new to mpi and i just discovered how to achiave a topology aware communicator, using mpi_graph_create. The thing that I cannot seem to achieve is to track messages through said topology.
For example if I call MPI_Send/MPI_Recv is 2 "non-adjacent" processes, is there a way to check the route that message takes through the graph?
I have downloaded IVT library ( Integrating Vision Toolkit), I made my app dependent on this library ( as DSP project in VC6.0) , I can partially compile the app because I get “permission denied” when I get to #include preprocessor statement.
I have checked the directory permissions and I have grayed out “read only” checked in IVT directory.
All of the sources I used so far said that such grayed out “read only” checked ( in XP) does not make any difference (?) when directories are involved.
All of my app directories have that grayed out “read only” checked and I have no problem including other (OpenCV) libraries.
I am tempted to recopy / re-download the IVT files , but would like to hear from the forum what is going on here.
Appreciate any advise.
Here is the real code snippet
I must be doing something really stupid.
#pragma message("include IVT ")
#include <Z:\Program Files\IVT\ivt-1.3.19\IVT\src> // fails
#include <Z:\Program Files\IVT\ivt-1.3.19\IVT\src\Calibration> // fails
#include <Z:\Program Files\IVT\ivt-1.3.19\IVT\src\Calibration\Calibration.h> // OK
I spoke too soon.
Now I need to figure out how to unclude all the header files of SUBDIRECTORIES. I need the IVT library in debug mode.
Do I have to create my own parent #include file ( such as
stdafx.h) with all the other headers or is it a time to learn how to use CMake?
There is a Make file in the IVT stuff I dowloaded , but I never used Make.
Do I have to create my own parent #include file ( such as stdafx.h) with all the other headers or is it a time to learn how to use CMake?
I'm not sure what you mean, the two are not connected. Using pre-compiled headers via stdafx.h merely helps to reduce the compile time of your source files, but you still need to #include all the individual header files. I have used make in the past and it is a good system, but I don't think it offers any advantages when you are creating Windows applications. Using the VS build system will do all you need.
One of the bygone useful features of the ancient days before DOS programming vanished, was ability, when I wanted to calculate something quickly, to quickly write a program where control started at the beginning and ran down the text like in a knitting pattern and and I did not have to catch Windows messages and events. A short example follows at the end of this message. Please, how can I use Visual C++ to write and run such a program, and how to run it? (I have Windows Vista).
I am writing a Visual C++ program, using features from an from an older Visual C++ program which I wrote. How can I (for example) get the compiler to use the version of the standard function GetFileName(.....) which needs a char* parameter rather than the version which needs a WCHAR* parameter?
is there a Article about CFormView, CView, CListView etc. for Beginners?
I always work with dialog based Applications, so i don’t have any experience with this Classes.
Any help would be great for me.
Here i like to thanks to all who help me before in my problems .