37
37
is meant all strings that can be used to denote a file. They can
38
38
be short relative names like <c>foo.erl</c>, very long absolute
39
39
name which include a drive designator and directory names like
40
<c>D:\\usr/local\\bin\\erl/lib\\tools\\foo.erl</c>, or any variations
40
<c>D:\usr/local\bin\erl/lib\tools\foo.erl</c>, or any variations
42
42
<p>In Windows, all functions return file names with forward slashes
43
43
only, even if the arguments contain back slashes. Use
44
44
<c>join/1</c> to normalize a file name by removing redundant
45
45
directory separators.</p>
46
<p>The module supports raw file names in the way that if a binary is present, or the file name cannot be interpreted according to the return value of
47
<seealso marker="kernel:file#native_name_encoding/0">file:native_name_encoding/0</seealso>, a raw file name will also be returned. For example filename:join/1 provided with a path component being a binary (and also not being possible to interpret under the current native file name encoding) will result in a raw file name being returned (the join operation will have been performed of course). For more information about raw file names, see the <seealso marker="kernel:file">file</seealso> module.</p>
49
51
<title>DATA TYPES</title>
51
name() = string() | atom() | DeepList
52
DeepList = [char() | atom() | DeepList]</code>
53
name() = string() | atom() | DeepList | RawFilename
54
DeepList = [char() | atom() | DeepList]
55
RawFilename = binary()
56
If VM is in unicode filename mode, string() and char() are allowed to be > 255.
57
RawFilename is a filename not subject to Unicode translation, meaning that it
58
can contain characters not conforming to the Unicode encoding expected from the
59
filesystem (i.e. non-UTF-8 characters although the VM is started in Unicode
329
338
["/","usr","local","bin"]
330
339
25> <input>filename:split("foo/bar").</input>
332
26> <input>filename:split("a:\\\\msdev\\\\include").</input>
341
26> <input>filename:split("a:\\msdev\\include").</input>
333
342
["a:/","msdev","include"]</pre>