[erlang-questions] : file:sync

Raimo Niskanen raimo+erlang-questions@REDACTED
Fri Mar 9 09:54:19 CET 2007


Sorry about the noresponse.

You are most probably right, and I do not know why _commit() is not used.
msdn.microsoft.com claims it has existed since Windows95, and that
you only have to include <io.h>.

We will simply have to insert a call to _commit(fd) in win_efile.c.
The change will come in a future release.

Thank you for finding the bug.



On Thu, Mar 08, 2007 at 10:50:53PM +0000, Matthew Sackman wrote:
> Hi,
> 
> Err, I'm slightly surprised there's been no response to this. Surely
> this has massive implications for the reliability of dets and mnesia,
> amongst other things like disk_log and general file operations on win32.
> Or is win32 a second-class citizen for Erlang?
> 
> On Wed, Mar 07, 2007 at 12:20:08PM +0000, Matthew Sackman wrote:
> > So, for ./erts/emulator/drivers/unix/unix_efile.c
> > 
> > int
> > efile_fsync(Efile_error *errInfo, /* Where to return error codes. */
> > 	    int fd)               /* File descriptor for file to sync. */
> > {
> > #ifdef NO_FSYNC
> > #ifdef VXWORKS
> >     return check_error(ioctl(fd, FIOSYNC, 0), errInfo); 
> > #else
> >   undefined fsync
> > #endif /* VXWORKS */
> > #else
> >     return check_error(fsync(fd), errInfo);
> > #endif /* NO_FSYNC */
> > }
> > 
> > ok - the important line being the last where fsync is actually called
> > which is in glibc unistd.h which is imported. Fine.
> > 
> > Then we have for ./erts/emulator/drivers/win32/win_efile.c
> > 
> > int
> > efile_fsync(errInfo, fd)
> > Efile_error* errInfo;		/* Where to return error codes. */
> > int fd;				/* File descriptor for file to sync. */
> > {
> >     return 1;
> > }
> 
> Matthew
> -- 
> Matthew Sackman
> http://www.wellquite.org/
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions

-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB



More information about the erlang-questions mailing list