Nп/п : 7 из 100
 От   : The Natural Philosopher             2:5075/128        14 сен 23 19:38:02
 К    : nev young                                             14 сен 23 21:41:02
 Тема : Re: Weird code crash
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@dont-email.me> 96668888
@REPLY: 1@dont-email.me> 8df557f7
@REPLYADDR The Natural Philosopher
<tnp@invalid.invalid>
@REPLYTO 2:5075/128 The Natural Philosopher
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@dont-email.me>
@RFC-References: 1@dont-email.me>
1@dont-email.me>
@TZUTC: 0100
@PID: Mozilla/5.0 (X11; Linux x86_64; rv:102.0)
Gecko/20100101 Thunderbird/102.15.1
@TID: FIDOGATE-5.12-ge4e8b94
On 14/09/2023 17:16, nev young wrote:
> 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.

both already done. Not closng it was the cause of a memory leak but I 
fixed that a fortnight ago.

I am beginning to wonder if I did more damage than just the power socket 
when I trod on it.

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


-- 
Canada is all right really, though not for the whole weekend.

"Saki"

 --- Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.15.1
 * Origin: A little, after lunch (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    
                                                                                
В этой области больше нет сообщений.

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