summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_file.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/couchdb/couch_file.erl')
-rw-r--r--src/couchdb/couch_file.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/couchdb/couch_file.erl b/src/couchdb/couch_file.erl
index 34d0c453..1f1fbe83 100644
--- a/src/couchdb/couch_file.erl
+++ b/src/couchdb/couch_file.erl
@@ -146,6 +146,9 @@ truncate(Fd, Pos) ->
%% or {error, Reason}.
%%----------------------------------------------------------------------
+sync(Filepath) when is_list(Filepath) ->
+ {ok, Fd} = file:open(Filepath, [read, raw]),
+ try file:sync(Fd) after file:close(Fd) end;
sync(Fd) ->
gen_server:call(Fd, sync, infinity).