Age | Commit message (Collapse) | Author |
|
Append mode doesn't work for files larger that 4GB on Windows.
Caused by incorrect usage of SetFilePointer in win_efile.c.
Fix uses OVERLAPPED structure to specify write position (EOF).
http://msdn.microsoft.com/en-us/library/aa365747.aspx
Opening file in append mode was also considered, but rejected, because
it might cause backwards incompatibility by limiting applicable
operations on the descriptor.
SetFilePointerEx was not used because it would caused more system calls
than using OVERLAPPED structure.
|
|
The mem_drv driver was only useful when elib_malloc was
active.
|
|
Add an option that atomically tests for the existence of a file and
creates it if the file does not exist, by passing the O_EXCL flag
to open() on Unix and CREATE_NEW flag on Windows. Support for O_EXCL
varies across platforms and filesystems.
{ok, Fd} = file:open("/tmp/foo", [write,exclusive]),
{error, eexist} = file:open("/tmp/foo", [write,exclusive]).
|
|
See dwShareMode on
http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx
|
|
* fm/file-operations:
Update preloaded modules
Add file:advise/4 - a wrapper to the POSIX syscall posix_fadvise
Add file:datasync/1 for syncing file contents only
sys.h: Correct the get_int64() macro
OTP-8637 fm/file-operations
The functions file:advise/4 and file:datasync/1 have been added. (Thanks to
Filipe David Manana.)
|
|
Useful for informing the Operating System about the access pattern
for a file's data, so that it can adapt the caching strategy to
maximize disk IO performance.
|
|
file:datasync/1 invokes the POSIX system call "int fdatasync(int fd)".
This system call is similar to "fsync" but, unlike fsync, it does not
update the metadata associated with the file (like the access time for
example). It's used by many DBMSs (MySQL and SQLite of example) to
increase disk IO performance, as it avoids disk seeks and disk write
operations compared to fsync.
More details on it at:
http://linux.die.net/man/2/fdatasync
An example, from the MySQL source:
http://bazaar.launchpad.net/~mysql/mysql-server/mysql-5.1-telco-6.1/annotate/head%3A/mysys/my_sync.c#L61
This new function just calls fsync on systems not implementing fdatasync.
|
|
|