Mai pune un os.fsync(); dupa fflush. Citat din docs[1]:
Note: flush() does not necessarily write the file’s data to disk. Use
flush() followed by os.fsync() to ensure this behavior.

Sau: open() fara buffering: f=open('blabla', 'a', 0);
Sau: open() in modul write, nu append (who knows...)

/Mures

[1]: https://docs.python.org/2/library/stdtypes.html?highlight=flush#file.flush

On Wed, Mar 16, 2016 at 11:27 AM, Paul Lacatus (Personal)
<[email protected]> wrote:
>
>
> On 3/16/2016 11:23 AM, Mures Andone wrote:
>>
>> Poate e stupid, dar incearca f.write("1\n");
>> echo adauga si un new line, cam asta e singura diferenta pe care o vad
>> eu...
>>
>> /Mures
>>
>  nope :
>
>>>> f= open ('/sys/bus/w1/devices/3a-0000002404ba/output','a')
>>>> f.write ("1\n")
>>>> f.flush()
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> IOError: [Errno 14] Bad address
>>>> f.close()
>>>>
>
>
> fara puls



-- 
...and justice for all...
_______________________________________________
RLUG mailing list
[email protected]
http://lists.lug.ro/mailman/listinfo/rlug

Raspunde prin e-mail lui