From b87886278f35569edd22817c87242134298250af Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Tue, 15 Jan 2013 14:52:28 +0100 Subject: [hipe, kernel, stdlib] Correct a few types The type ascii_string() in the base64 module has been corrected. The type file:file_info() has been cleaned up. The type file:fd() has been made opaque in the documentation. The type nodes() has been removed from erl_bif_types.erl. --- lib/hipe/cerl/erl_bif_types.erl | 5 +--- lib/kernel/doc/src/file.xml | 53 +++++++++++++++++++----------------- lib/kernel/include/file.hrl | 59 ++++++++++++++++++++++------------------- lib/stdlib/src/base64.erl | 4 +-- 4 files changed, 64 insertions(+), 57 deletions(-) (limited to 'lib') diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl index 98d65abba1..d93ad10bd4 100644 --- a/lib/hipe/cerl/erl_bif_types.erl +++ b/lib/hipe/cerl/erl_bif_types.erl @@ -2,7 +2,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2003-2012. All Rights Reserved. +%% Copyright Ericsson AB 2003-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -765,7 +765,6 @@ type(erlang, node, 0, _) -> t_node(); %% Guard bif, needs to be here. type(erlang, node, 1, Xs) -> strict(arg_types(erlang, node, 1), Xs, fun (_) -> t_node() end); -type(erlang, nodes, 0, _) -> t_list(t_node()); %% Guard bif, needs to be here. type(erlang, round, 1, Xs) -> strict(arg_types(erlang, round, 1), Xs, fun (_) -> t_integer() end); @@ -2250,8 +2249,6 @@ arg_types(erlang, node, 0) -> %% Guard bif, needs to be here. arg_types(erlang, node, 1) -> [t_identifier()]; -arg_types(erlang, nodes, 0) -> - []; %% Guard bif, needs to be here. arg_types(erlang, round, 1) -> [t_number()]; diff --git a/lib/kernel/doc/src/file.xml b/lib/kernel/doc/src/file.xml index e30ade1bd2..4a9b7d2ceb 100644 --- a/lib/kernel/doc/src/file.xml +++ b/lib/kernel/doc/src/file.xml @@ -4,7 +4,7 @@
- 19962012 + 19962013 Ericsson AB. All Rights Reserved. @@ -100,7 +100,11 @@ - + fd() + +

A file descriptor representing a file opened in raw mode.

+
@@ -109,8 +113,8 @@

As returned by - file:open/2, - a process handling I/O-protocols.

+ file:open/2; + pid() is a process handling I/O-protocols.

@@ -662,7 +666,8 @@ raw -

The raw option allows faster access to a file, +

+ The raw option allows faster access to a file, because no Erlang process is needed to handle the file. However, a file opened in this way has the following limitations:

@@ -1251,11 +1256,11 @@

The record file_info contains the following fields.

- size = integer() + size = integer() >= 0

Size of file in bytes.

- type = device | directory | regular | other + type = device | directory | other | regular | symlink

The type of the file.

@@ -1263,22 +1268,22 @@

The current system access to the file.

- atime = date_time() | integer() + atime = date_time() | integer() >= 0

The last time the file was read.

- mtime = date_time() | integer() + mtime = date_time() | integer() >= 0

The last time the file was written.

- ctime = date_time() | integer() + ctime = date_time() | integer() >=0

The interpretation of this time field depends on the operating system. On Unix, it is the last time the file or the inode was changed. In Windows, it is the create time.

- mode = integer() + mode = integer() >= 0

The file permissions as the sum of the following bit values:

@@ -1309,33 +1314,33 @@

On Unix platforms, other bits than those listed above may be set.

- links = integer() + links = integer() >= 0

Number of links to the file (this will always be 1 for file systems which have no concept of links).

- major_device = integer() + major_device = integer() >= 0

Identifies the file system where the file is located. In Windows, the number indicates a drive as follows: 0 means A:, 1 means B:, and so on.

- minor_device = integer() + minor_device = integer() >= 0

Only valid for character devices on Unix. In all other cases, this field is zero.

- inode = integer() + inode = integer() >= 0

Gives the inode number. On non-Unix file systems, this field will be zero.

- uid = integer() + uid = integer() >= 0

Indicates the owner of the file. Will be zero for non-Unix file systems.

- gid = integer() + gid = integer() >= 0

Gives the group that the owner of the file belongs to. Will be zero for non-Unix file systems.

@@ -1766,22 +1771,22 @@

The following fields are used from the record, if they are given.

- atime = date_time() | integer() + atime = date_time() | integer() >= 0

The last time the file was read.

- mtime = date_time() | integer() + mtime = date_time() | integer() >= 0

The last time the file was written.

- ctime = date_time() | integer() + ctime = date_time() | integer() >= 0

On Unix, any value give for this field will be ignored (the "ctime" for the file will be set to the current time). On Windows, this field is the new creation time to set for the file.

- mode = integer() + mode = integer() >= 0

The file permissions as the sum of the following bit values:

@@ -1812,15 +1817,15 @@

On Unix platforms, other bits than those listed above may be set.

- uid = integer() + uid = integer() >= 0

Indicates the owner of the file. Ignored for non-Unix file systems.

- gid = integer() + gid = integer() >= 0

Gives the group that the owner of the file belongs to. - Ignored non-Unix file systems.

+ Ignored for non-Unix file systems.

Typical error reasons:

diff --git a/lib/kernel/include/file.hrl b/lib/kernel/include/file.hrl index bf97173122..69aec1ee36 100644 --- a/lib/kernel/include/file.hrl +++ b/lib/kernel/include/file.hrl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 1997-2011. All Rights Reserved. +%% Copyright Ericsson AB 1997-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -22,32 +22,37 @@ %%-------------------------------------------------------------------------- -record(file_info, - {size :: non_neg_integer(), % Size of file in bytes. - type :: 'device' | 'directory' | 'other' | 'regular' | 'symlink', - access :: 'read' | 'write' | 'read_write' | 'none', - atime :: file:date_time() | integer(), % The local time the file was last read: - % {{Year, Mon, Day}, {Hour, Min, Sec}}. - % atime, ctime, mtime may also be unix epochs() - mtime :: file:date_time() | integer(), % The local time the file was last written. - ctime :: file:date_time() | integer(), % The interpretation of this time field - % is dependent on operating system. - % On Unix it is the last time the file - % or the inode was changed. On Windows, - % it is the creation time. - mode :: integer(), % File permissions. On Windows, - % the owner permissions will be - % duplicated for group and user. - links :: non_neg_integer(), % Number of links to the file (1 if the - % filesystem doesn't support links). - major_device :: integer(), % Identifies the file system (Unix), - % or the drive number (A: = 0, B: = 1) - % (Windows). - %% The following are Unix specific. - %% They are set to zero on other operating systems. - minor_device :: integer(), % Only valid for devices. - inode :: integer(), % Inode number for file. - uid :: integer(), % User id for owner. - gid :: integer()}). % Group id for owner. + {size :: non_neg_integer(), % Size of file in bytes. + type :: 'device' | 'directory' | 'other' | 'regular' | 'symlink', + access :: 'read' | 'write' | 'read_write' | 'none', + atime :: file:date_time() | non_neg_integer(), + % The local time the file was last read: + % {{Year, Mon, Day}, {Hour, Min, Sec}}. + % atime, ctime, mtime may also be unix epochs() + mtime :: file:date_time() | non_neg_integer(), + % The local time the file was last written. + ctime :: file:date_time() | non_neg_integer(), + % The interpretation of this time field + % is dependent on operating system. + % On Unix it is the last time the file + % or the inode was changed. On Windows, + % it is the creation time. + mode :: non_neg_integer(), % File permissions. On Windows, + % the owner permissions will be + % duplicated for group and user. + links :: non_neg_integer(), + % Number of links to the file (1 if the + % filesystem doesn't support links). + major_device :: non_neg_integer(), + % Identifies the file system (Unix), + % or the drive number (A: = 0, B: = 1) + % (Windows). + %% The following are Unix specific. + %% They are set to zero on other operating systems. + minor_device :: non_neg_integer(), % Only valid for devices. + inode :: non_neg_integer(), % Inode number for file. + uid :: non_neg_integer(), % User id for owner. + gid :: non_neg_integer()}). % Group id for owner. -record(file_descriptor, diff --git a/lib/stdlib/src/base64.erl b/lib/stdlib/src/base64.erl index 5d800e87b8..0068d82d43 100644 --- a/lib/stdlib/src/base64.erl +++ b/lib/stdlib/src/base64.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2011. All Rights Reserved. +%% Copyright Ericsson AB 2007-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -28,7 +28,7 @@ %% of (some) functions of this module. %%------------------------------------------------------------------------- --type ascii_string() :: [1..255]. +-type ascii_string() :: [1..127]. %%------------------------------------------------------------------------- %% encode_to_string(ASCII) -> Base64String -- cgit v1.2.3