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/doc/src/file.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/kernel/doc/src/file.xml') diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index 66ecba1bf2..71db9b66bd 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -1622,6 +1622,11 @@

Sets the current working directory of the file server to Dir. Returns ok if successful.

+

The functions in the file module usually treat binaries + as raw filenames, i.e. they are passed as is even when the encoding + of the binary does not agree with file:native_name_encoding(). + This function however expects binaries to be encoded according to the + value returned by file:native_name_encoding().

Typical error reasons are:

enoent @@ -1646,8 +1651,8 @@ no_translation

Dir is a binary() with - characters coded in ISO-latin-1 and the VM was started - with the parameter +fnue.

+ characters coded in ISO-latin-1 and the VM is operating + with unicode file name encoding.

-- cgit v1.2.3