From b45af5f9608d5dc79a5f201afdcc9a7e28e7ba83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Thu, 27 Feb 2014 12:41:53 +0100 Subject: Correct file:set_cwd/1 typespec file:set_cwd/1 accepts binaries as arguments, however the binaries must be properly encoded as per file:native_name_encoding/0. Also update the note under no_translation error to refer that passing a ISO-latin-1 encoded binary under any unicode file name encoding. --- lib/kernel/src/file.erl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/kernel/src/file.erl') diff --git a/lib/kernel/src/file.erl b/lib/kernel/src/file.erl index 36289053eb..5467175654 100644 --- a/lib/kernel/src/file.erl +++ b/lib/kernel/src/file.erl @@ -197,7 +197,8 @@ get_cwd(Drive) -> check_and_call(get_cwd, [file_name(Drive)]). -spec set_cwd(Dir) -> ok | {error, Reason} when - Dir :: name(), + Dir :: name() | EncodedBinary, + EncodedBinary :: binary(), Reason :: posix() | badarg | no_translation. set_cwd(Dirname) -> -- cgit v1.2.3