I have a requirement to store my log files in a Logs sub folder. Normally you would do this my modifying the FileAppender in you App.config as follows: However this is not cross platform because if you run this on linux it will create a file called ‘LogsMyLog.log’ rather then a directory. This is because ” is not a path
Tag: c++
How can I make my program compile without warning?
I should compile my program with spec flags to gcc. Then gcc complained about return values not taken care of. WhenI use variables to take the return values then gcc complains again: How can I resolve the warnings? My program is as follows. Answer Reading between the lines, I guess the original problem you were trying to solve was a
Writing a background program with command line interaction [closed]
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 7 years ago. Improve this question I’m just playing around and want to write a c++ program that monitors my CPU temperature, (i know there is
Strange error while trying to deploy qt5 app on raspberry pi
I have a project which I’ve made on Ubuntu 14.04 LTS, but then, I wanted to test if the Raspberry Pi was capable of running this little program of mine. Then I’ve followed the instructions on this link to compile and build qt5 natively on the Pi. I’ve managed to install qt5 without problems, I could even compile and run
Why we call the signal function in the start of the linux c program?
The program is very simple, I have a handler function named fintr() and the program is: Can I put signal(SIGINT,fintr); at the end of the function main()? And why do we have to put it in the beginning of main()? Answer Putting it at the end means it will come after the while (1) … loop, so no, you can’t
How to mount image using mount(2)
I cannot mount some IMAGE on the MacOSX 10.10 via C function mount(). I use following code And when I start the program I get the error “mount() is failed! Error(Operation not supported by device).” And image was mounted if I use the following command: Also, when I use mount() on the Linux – All is OK. Following Linux code:
How to squash bug that only occurs with optimizations enabled
I’m in a bit of a pickle. I have some code that until recently ran fine but has now started to fail when optimizations are enabled. This code runs just fine with optimizations disabled -O0 both -O1 and -O2 cause the issue to occur (I don’t use -O3). Unfortunately, I can’t post the source code (it’s rather involved and proprietary)
Strtok behaviour with delimiter
Below is the code snippet. This works fine. But, when the “line” argument is “Front Board Memory status:Correctable ECC / other correctable memory error detected ; sensor (70, Memory)” The output will be 70 SENSOR_SPECIFIC MEMORY STATE_00 True 8543 Front Board Memory status where the short_text variable contains only “Front Board Memory status” instead of “Front Board Memory status:Correctable ECC
Workaround for bug in mono: Wrong Process.ProcessName
If you work with mono and use Process.ProcessName you may get wrong results on some computers. For example instead of the process name “kwrite” you may get “kdeinit4” (seen on SUSE). On Ubuntu I have even seen complete bullshit like “kdeinit4;5535948c (deleted)” instead of “kwrite”. Note: On other computers the result may be correct. If I use Process.MainModule.ModuleName it retruns
Executable file didn’t work correctly [Linux]
I write a program on Qt C++ GUI, that from given user input generates three .cpp files with proper syntax (C++). When I start my program from Qt Creator directly or run it from console like a script its creates the files in executable directory correctly: When I double click executable file, the program starts and work fine, but It