This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Strange error with fopen
I am really a silly programmer :-)
I use my_time=localtime() to get current time to create directory but when the system is on heavy load my_time changes it values so i create /2004/04/07/18/19/16 directory but open /2004/04/07/18/19/17/636.jpg file. too bad :).
I change my_time=localtime() with memcpy(my_time,localtime(),sizeof(struct tm)).
I could not fount this error without strace thanks a lot for your suggest.
Saluti Carlo!
Il Wed, 7 Apr 2004 20:52:39 +0300
Denis Vlasenko <vda@port.imtp.ilyichevsk.odessa.ua> scrisse:
> On Wednesday 07 April 2004 19:22, Devel wrote:
> > OK i resoved my problem and my apps work with strace. This is a piece of
> > strace output: strace -fftt -F -o strace ./myapps
> >
> > 18:19:17.305867 rt_sigsuspend([HUP INT USR1 ALRM TERM RT_3]18:19:17.336078
> > --- SIGRTMIN (Unknown signal 32) @ 0 (0) --- ) = -1 EINTR (Interrupted
> > system call)
> > 18:19:17.339346 sigreturn() = ? (mask now [HUP INT USR1 ALRM TERM RTMIN])
> > 18:19:17.349275 kill(13939, SIGRTMIN) = 0
> > 18:19:17.349366 open("/2004/04/07/18/19/17/636.jpg",
> > O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENOENT 18:19:17.349470
> > rt_sigprocmask(SIG_SETMASK, NULL, [HUP INT USR1 ALRM TERM RTMIN RT_3], 8) =
> > 0 18:19:17.349750 rt_sigsuspend([HUP INT USR1 ALRM TERM
> > RT_3]18:19:17.362717 --- SIGRTMIN (Unknown signal 32) @ 0 (0) --- ) = -1
> > EINTR (Interrupted system call)
> > 18:19:17.362771 sigreturn() = ? (mask now [HUP INT USR1 ALRM
> > TERM RTMIN])
> >
> > It seem that O_CREAT doesn't work fine.I hope this can help!
>
> open() won't create directories for you.
> Does /2004/04/07/18/19/17 really exist on your system?
> --
> vda
>
>