R
Ron Eggler
Hi,
I would like to write binary data in a file i open (ofstream) with
ios::binary but it keeps failing and it gives me a segmentation fault.
What I'm exactly doing:
[C++]
if (isBinary == true)
{
std::cout << "open(" << filename.c_str() << ", std::ios::binary |
std::ios::trunc);" << std::endl;
ofs->open(filename.c_str(), std::ios::binary | std::ios::trunc);
}
[/C++]
And the output on my shell(as root) looks like:
[shell]
Filename: /root/PRS_UPDATE/prs
open(/root/PRS_UPDATE/prs, std::ios::binary | std::ios::trunc);
Segmentation fault (core dumped)
[/shell]
The permissions of folder /root/PRS_UPDATE look like:
root@NovaxPRG-T1111:~/src/updater/build# ls -la /root/PRS_UPDATE/
total 8
drwxrwxrwx 2 reg users 4096 2008-04-25 09:10 .
drwxr-xr-x 10 root root 4096 2008-04-25 09:10 ..
I'm not understanding, anyone an idea where the problem could be?
Any suggestions are highly appreciated!
Thank you!
Ron
I would like to write binary data in a file i open (ofstream) with
ios::binary but it keeps failing and it gives me a segmentation fault.
What I'm exactly doing:
[C++]
if (isBinary == true)
{
std::cout << "open(" << filename.c_str() << ", std::ios::binary |
std::ios::trunc);" << std::endl;
ofs->open(filename.c_str(), std::ios::binary | std::ios::trunc);
}
[/C++]
And the output on my shell(as root) looks like:
[shell]
Filename: /root/PRS_UPDATE/prs
open(/root/PRS_UPDATE/prs, std::ios::binary | std::ios::trunc);
Segmentation fault (core dumped)
[/shell]
The permissions of folder /root/PRS_UPDATE look like:
root@NovaxPRG-T1111:~/src/updater/build# ls -la /root/PRS_UPDATE/
total 8
drwxrwxrwx 2 reg users 4096 2008-04-25 09:10 .
drwxr-xr-x 10 root root 4096 2008-04-25 09:10 ..
I'm not understanding, anyone an idea where the problem could be?
Any suggestions are highly appreciated!
Thank you!
Ron