hi, not sure if this will help but it tried it and it worked for me.
cout<< system("attrib c:/test.txt") << endl;
assuming that you have a file called test.txt in the root of your c drive.
also to modify the attributes open a dos window and type 'attrib /?' with out quotes and it will give you the switches to modify the attributes.
Bruce
User Profile
Collapse
-
file name issue.
Hi guys.
i was wondering, is there a way to open a stream to an unknown file or files.
for eg. i normally use,
ifstream in("some directory/only_this_file. txt");
// do something to the input
in.close();
ofstream out ("another dirctory/only_that_file. txt");
//write to file
out.close();
but say i wanted to do that to a whole directory of... -
-
why does copy not work?
Hi all to all.
first post here on the scripts
Maybe someone could explain this to me, why is it that if i open two streams
ifstream in ("some_doc.txt" );
ofstream out ("copy_of_some_ doc.txt")
to 2 txt documents and use
string lines;
while(getline, in) {
in>> line;
out<< line << endl;
}
in.close();...
No activity results to display
Show More
Leave a comment: