Nп/п : 4 из 100
 От   : nev young                           2:5075/128        14 сен 23 17:16:23
 К    : The Natural Philosopher                               14 сен 23 19:19:02
 Тема : Re: Weird code crash
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> 8df557f7
@REPLY: 1@dont-email.me> a0d70510
@REPLYADDR nev young
<newsforpasiphae1953@yahoo.co.uk>
@REPLYTO 2:5075/128 nev young
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@dont-email.me>
@RFC-Reply-To: newsforpasiphae1953@yahoo.co.uk
@TZUTC: 0100
@PID: Mozilla/5.0 (X11; Linux x86_64; rv:102.0)
Gecko/20100101 Thunderbird/102.15.0
@TID: FIDOGATE-5.12-ge4e8b94
On 14/09/2023 06:23, The Natural Philosopher wrote:
> I don`t expect people to know the answer, but I could use some help in 
> puzzling out where to look.

> One possibility is that it is opening and reading a file at the precise 
> time another process is writing it...in both cases the read and write 
> operations are atomic and done with C code.

> READ
> ====
> fp=fopen(fullname, "r");
> len=fread(filbuf,1,255,fp); // read entire file

Elsewhere in this thread it is suggested checking fp!=nul.
Not knowing what the actual program is doing might I suggest also 
closing fp after it has been read.


> WRITE
> =====
> fp=fopen(filename, "w");
> if (fp)
>      {
>      fprintf(fp,"%s%s
",filedata,timestamp);
>      fclose(fp);
>      }


-- 
Nev
It causes me a great deal of regret and remorse
that so many people are unable to understand what I write.

 --- Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.0
 * Origin: newsforpasiphae1953 (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5058/104 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх