Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: mrsudhi on February 18, 2013, 04:59:52 am
-
I have written a C program, one of the operation it does is copying contents from one file to other.
The original file is usually a read only file.
If the file is read only, the the copy of file just doesn't happen, but if I manually give read permission to the file it works fine.
In unix, I know I can call system(chmod 777 abc.c) to give write permission to file.
But my question is how can I achieve this in windows?
i.e. how can I give write permission to a windows file from C code?
Thanks in advance.
-
You need to create a (new) r/w file, read the contents of the source and write it to the target. You must pass if the source can be read. A "high level copy" can copy permissions, too, something you must avoid. But this is not a Code Blocks related problem.
-
Unrelated to C::B and therefore violating our forum rules.
Topic locked !