You are here:

C++/file permissions and C++


#include <stdio.h>
#include <iostream.h>

int main(){
cout << "Content-type: text/html\n\n";
cout << "<html><body>successful";
cout << "</body></html>";
return 0;

when i execute the following code online,
the new file that is produced haha.txt's file permission is set as nobody.

is there a way that i can set that permission to the owner of the execution file?

thank you..

Hello James, thank you for the question.

I actually had no idea how to do this, since I've never had to before, so I asked a coworker. He said that the C runtime functions stat() and fstat() should have you good to go. You can look these functions up in the MSDN library for detailed descriptions and code samples at Sorry I couldn't provide a better explanation.

- Eddie


All Answers

Answers by Expert:

Ask Experts




I can answer questions about the C++ language, object oriented design and architecture. I am knowledgable in a lot of the math that goes into programming, and am certified by I also know a good deal about graphics via OpenGL, and GUIs.


I have completed numerous games and demos created with the C++ programming language. Currently employed as a software engineer in the modeling and simulation field. I have about 7 years experience.

©2016 All rights reserved.