[PATCH] Fix -spec for file:write_file/3

Magnus Henoch magnus.henoch@REDACTED
Mon Feb 14 12:54:22 CET 2011


Change type for second parameter from binary() to iodata(), since the
function explicitly takes steps to accept lists as well as binaries.
---
 lib/kernel/src/file.erl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl
index bc95359..a7a6e96 100644
--- a/lib/kernel/src/file.erl
+++ b/lib/kernel/src/file.erl
@@ -240,7 +240,7 @@ write_file(Name, Bin) ->
 %% when it is time to change file server protocol again.
 %% Meanwhile, it is implemented here, slightly less efficient.
 
--spec write_file(Name :: name(), Bin :: binary(), Modes :: [mode()]) -> 
+-spec write_file(Name :: name(), Bin :: iodata(), Modes :: [mode()]) -> 
 	'ok' | {'error', posix()}.
 
 write_file(Name, Bin, ModeList) when is_list(ModeList) ->
-- 
1.7.0.4



More information about the erlang-patches mailing list