I don't use node.js, so I am not familiar with it.
The name of the function suggests that it does a 'sync' after the write,
which is what you want.
In Linux, the 'sync' command flushes all the buffers to disk.
I would just read the manual on the function to make sure it is doing what
you want.
--- Graham

==

On Tue, Mar 20, 2018 at 12:28 PM, Troy Weber <troywwe...@gmail.com> wrote:

> How would you flush the sd card buffers from node.js? To write to the
> files I am doing using the *writeFileSync* command.
>
>
> On Monday, March 19, 2018 at 5:55:12 PM UTC-7, Graham wrote:
>>
>> As a matter of buffer hygiene, are you flushing the buffers to the sd
>> card after every time you write to it?
>> Something like the equivalent of the 'sync' command?
>> If there is still unwritten info in the buffers when the power gets
>> pulled, bye-bye data.
>>
>> In Linux, when the mounted drive is suddenly declared "read-only" it
>> means that the OS has observed some corruption or error in the file system,
>> and does so to prevent further corruption.
>>
>> --- Graham
>>
>> ==
>>
>> On Monday, March 19, 2018 at 6:59:29 PM UTC-5, Wulf Man wrote:
>>>
>>> I dont know if its for sale there was a battery cape
>>> or you can go with custom hardware
>>>
>>>
>>> On 3/19/2018 4:56 PM, Troy Weber wrote:
>>>
>>> Well we need to be able to pull the plug without damaging things. Is the
>>> best option then to have a battery system that allows BBB to listen for
>>> loss of power and gracefully shut down? Are there alternative methods?
>>>
>>> Troy Weber
>>> Mechatronics / Software Developer
>>> troyw...@gmail.com
>>> 707-761-1644 <(707)%20761-1644>
>>> sent from mobile
>>>
>>> On Mon, Mar 19, 2018, 4:42 PM evilwulfie <evilw...@gmail.com> wrote:
>>>
>>>> Well yes if you fail to unmount a file system you can have issues.
>>>> On my systems i designed a battery backup system to prevent just the
>>>> issues you
>>>> are seeing now.
>>>> It does not happen all the time but one time is unacceptable.
>>>>
>>>> Beaglebone is a live filesystem and you cant just pull the plug.
>>>>
>>>> --
>>>> For more options, visit http://beagleboard.org/discuss
>>>> ---
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "BeagleBoard" group.
>>>> To unsubscribe from this topic, visit https://groups.google.com/d/to
>>>> pic/beagleboard/MfN646FtxiA/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> beagleboard...@googlegroups.com.
>>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>>> gid/beagleboard/9e31b553-0c83-640b-99ab-b1b3f2c993ce%40gmail.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>> For more options, visit http://beagleboard.org/discuss
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "BeagleBoard" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to beagleboard...@googlegroups.com.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/beagleboard/CAPMxd4SkyyydxiQgzeKQY%3DKoryWZ792Wuxv2%
>>> 2BvW2Cgv-KjbwsQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/beagleboard/CAPMxd4SkyyydxiQgzeKQY%3DKoryWZ792Wuxv2%2BvW2Cgv-KjbwsQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "BeagleBoard" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/beagleboard/MfN646FtxiA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beagleboard/980149f3-a0a8-4863-a327-3fd4a0e2657a%40googlegroups.com
> <https://groups.google.com/d/msgid/beagleboard/980149f3-a0a8-4863-a327-3fd4a0e2657a%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CANN_KV5qK0zke1B88DA2U9dS4PdCeqfZZrV-WGhedZxHJ5x%3Dng%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to