Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Read only files in windows
From: BlueChip (cs_bluechip_at_webtribe.net)
Date: 2004-07-07


I have noticed that any files created under windows by the simulator end up
being read only.
I did a search and found exactly what I needed (don't you just love google)

http://www.cygwin.com/ml/cygwin/2003-11/msg00469.html

A copy of the post at that link is below...

BC

>I got a question wrt to gcc and cygwin. I'm not sure if this is the defined
>behaviour, but for some reason, the following code fails. This is a test
>program which display the failure.
>Running cygwin on windows 2000. Compiling with mingw (no-cygwin option)
>
>Basically, after creat...close... the file is set to read only (check
>attributes under windows). This causes the second to fail. On the
second run
>of the program, the creat fails as well. Any idea why the file is being
set to
>read only?
>
>********************************************************
>#include <io.h>
>#include <stdio.h>
>#include <fcntl.h>
>
>int main()
>{
> int handle;
> handle= creat("hello.txt", O_WRONLY);
                                ^^^^^^^^
This isn't the correct argument for creat. The second argument is
the mode, as in what you send to chmod (2).

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa