[erlang-questions] Erlang and fsync

Wojtek Narczyński wojtek@REDACTED
Sun Aug 3 11:42:33 CEST 2014


On 03.08.2014 02:07, Magnus Ahltorp wrote:
>
> On some operating systems, it might take a very long time for data to reach the disk, and that is not acceptable in my case. By "soft", I meant that the operating system has done all it can to ensure that the data is permanently stored, but of course the disk can choose not to obey that (which many disks choose to). There is a difference between "reached the disk" and "permanently stored".
>

If a system is under heavy IO load, this is definitely so. If you are on 
Linux, you can use ionice to control this to some extent.

> But prim_file is not documented, and also refuses to open directories:

prim_file is undocumented, but file is radioactive. You have been warned.

> Eshell V6.1  (abort with ^G)
> 1> prim_file:open("/tmp", [read]).
> {error,eisdir}

Indeed. I have looked at the source, and the problem is not there, it's 
probably in the C driver, so no luck here. If memory serves me well, you 
can't open a directory into a descriptor in Win32, so this is probably 
the reason why things are so.

> And regarding changing the Erlang libraries, that is interesting looking forward, but this has to work now, without patching Erlang locally,

You don't have to patch, you can just fork a local copy of a function or 
module.

>   so my question stands: "How do people solve this?".
>
>

Well, looks like people don't.

But it is rather simple an excercise with a port program.

-- 
Wojtek



More information about the erlang-questions mailing list