Age | Commit message (Collapse) | Author |
|
|
|
* erlang:universaltime_to_seconds/1 changed to
erlang:universaltime_to_posixtime/1
* erlang:seconds_to_universaltime/1 changed to
erlang:posixtime_to_universaltime/1
Let prim_file.erl reflect these changes.
|
|
* 'utc' changed to 'universal'
* 'epoch' changed to 'posix'
This change conforms to other naming already in OTP, e.g.
erlang:universaltime_to_localtime/1.
|
|
We do not want to crash the file server.
|
|
|
|
|
|
|
|
|
|
|
|
First stage in utc-time for prim_file.
|
|
Since the API for headers/trailers seem to be very awkward to
work with when using non-blocking io the feature is dropped
for now. See unix_efile.c for more details.
|
|
|
|
Have to figure out how to represent progress in header writing when
using non-blocking, not sure how to do this.
|
|
Move sendfile data to invoke data instead of file_descr.
Remove usage of ready_output when doing a send.
If told to send 0 bytes, file_sendfile now sends the entire file
for linux.
|
|
Move the command handling to outputv in preparation for
header and trailer inclusion in the sendfile api.
Use the standard efile communication functions for sendfile.
|
|
Created erlang fallback for sendfile in gen_tcp and
moved sendfile from file to gen_tcp. Also created testcases
for testing all different options to sendfile.
For info about how sendfile should work see the BSD man pages
as they contain a more complete API than other *nixes.
|
|
Allow Erlang code to use sendfile() where available by wrapping it as
file:sendfile/4 and file:sendfile/2.
sendfile(2) - Linux man page:
"sendfile() copies data between one file descriptor and another.
Because this copying is done within the kernel, sendfile() is more
efficient than the combination of read(2) and write(2), which would
require transferring data to and from user space."
|
|
Conflicts:
erts/aclocal.m4
erts/include/internal/ethread_header_config.h.in
|
|
|
|
|
|
The efile driver will now use chunked data on list_dir. This will
lessen the number of sends to prim_file and hence improve
performance. This method is utilized in both direct and async cases.
|
|
An experimental version of Dialyzer discovered that the atom that
replaced the DRV macro in prim_file ends up in calls to
erlang:open_port({spawn, Driver}, Portopts) as the Driver argument. The
documentation states that this call requires a string there.
This change is also consistent with the one introduced in commit
0f03b1e9d2bef3bc830c31a369261af4c5234727 by Kostis Sagonas.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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]).
|
|
* 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.
|
|
|