| delorie.com/archives/browse.cgi | search |
| From: | Maxximo <mssmsoft AT my-deja DOT com> |
| Newsgroups: | comp.os.msdos.djgpp |
| Subject: | Re: File opening error |
| Date: | Fri, 09 Jul 1999 11:59:37 GMT |
| Organization: | Deja.com - Share what you know. Learn what you don't. |
| Lines: | 16 |
| Message-ID: | <7m4o75$8cb$1@nnrp1.deja.com> |
| References: | <F821915ECD30D3119CC3005004267603065BF3 AT spzmg01 DOT spzexch01> <3785A4D2 DOT 398B0B27 AT accord-soft DOT com> |
| NNTP-Posting-Host: | 138.132.53.11 |
| X-Article-Creation-Date: | Fri Jul 09 11:59:37 1999 GMT |
| X-Http-User-Agent: | Mozilla/3.04Gold (X11; I; OSF1 V4.0 alpha) |
| X-Http-Proxy: | 1.0 x26.deja.com:80 (Squid/1.1.22) for client 138.132.53.11 |
| To: | djgpp AT delorie DOT com |
| DJ-Gateway: | from newsgroup comp.os.msdos.djgpp |
| Reply-To: | djgpp AT delorie DOT com |
Description of 'creat' function in libc.a reference:
<omissis> if the file does not exist, it will be created read-only if
mode does not have S_IWUSR set.
When you creat the file, the file is read only. Then you cannot open it
in write mode. To solve your problem try this:
open("filename", O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);
Good Luck,
Massimo
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |