~ubuntu-branches/ubuntu/trusty/erlang/trusty

« back to all changes in this revision

Viewing changes to lib/stdlib/doc/src/filename.xml

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum
  • Date: 2011-05-05 15:48:43 UTC
  • mfrom: (3.5.13 sid)
  • Revision ID: james.westby@ubuntu.com-20110505154843-0om6ekzg6m7ugj27
Tags: 1:14.b.2-dfsg-3ubuntu1
* Merge from debian unstable.  Remaining changes:
  - Drop libwxgtk2.8-dev build dependency. Wx isn't in main, and not
    supposed to.
  - Drop erlang-wx binary.
  - Drop erlang-wx dependency from -megaco, -common-test, and -reltool, they
    do not really need wx. Also drop it from -debugger; the GUI needs wx,
    but it apparently has CLI bits as well, and is also needed by -megaco,
    so let's keep the package for now.
  - debian/patches/series: Do what I meant, and enable build-options.patch
    instead.
* Additional changes:
  - Drop erlang-wx from -et
* Dropped Changes:
  - patches/pcre-crash.patch: CVE-2008-2371: outer level option with
    alternatives caused crash. (Applied Upstream)
  - fix for ssl certificate verification in newSSL: 
    ssl_cacertfile_fix.patch (Applied Upstream)
  - debian/patches/series: Enable native.patch again, to get stripped beam
    files and reduce the package size again. (build-options is what
    actually accomplished this)
  - Remove build-options.patch on advice from upstream and because it caused
    odd build failures.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
<erlref>
5
5
  <header>
6
6
    <copyright>
7
 
      <year>1997</year><year>2009</year>
 
7
      <year>1997</year><year>2010</year>
8
8
      <holder>Ericsson AB. All Rights Reserved.</holder>
9
9
    </copyright>
10
10
    <legalnotice>
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
41
41
      in between.</p>
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>
46
48
  </description>
47
49
 
48
50
  <section>
49
51
    <title>DATA TYPES</title>
50
52
    <code type="none">
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 
 
60
  filename mode).
 
61
    </code>
53
62
  </section>
54
63
  <funcs>
55
64
    <func>
173
182
14> <input>filename:dirname("kalle.erl").</input>
174
183
"."
175
184
 
176
 
5> <input>filename:dirname("\\\\usr\\\\src/kalle.erl").</input> % Windows
 
185
5> <input>filename:dirname("\\usr\\src/kalle.erl").</input> % Windows
177
186
"/usr/src"</pre>
178
187
      </desc>
179
188
    </func>
228
237
18> <input>filename:join(["a/b///c/"]).</input>
229
238
"a/b/c"
230
239
 
231
 
6> <input>filename:join(["B:a\\\\b///c/"]).</input> % Windows
 
240
6> <input>filename:join(["B:a\\b///c/"]).</input> % Windows
232
241
"b:a/b/c"</pre>
233
242
      </desc>
234
243
    </func>
259
268
"/usr/local/bin"
260
269
 
261
270
7> <input>filename:nativename("/usr/local/bin/").</input> % Windows
262
 
"\\\\usr\\\\local\\\\bin"</pre>
 
271
"\\usr\\local\\bin"</pre>
263
272
      </desc>
264
273
    </func>
265
274
    <func>
329
338
["/","usr","local","bin"]
330
339
25> <input>filename:split("foo/bar").</input>
331
340
["foo","bar"]
332
 
26> <input>filename:split("a:\\\\msdev\\\\include").</input>
 
341
26> <input>filename:split("a:\\msdev\\include").</input>
333
342
["a:/","msdev","include"]</pre>
334
343
      </desc>
335
344
    </func>