Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bootstrap/lib/kernel/ebin/auth.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/code.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/code_server.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/disk_log.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/disk_log_1.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/disk_log_server.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/file.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/file_io_server.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/gen_tcp.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/inet_db.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/inet_parse.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/logger_std_h.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/os.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/ram_file.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/raw_file_io_compressed.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/raw_file_io_deflate.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/raw_file_io_delayed.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/raw_file_io_inflate.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/raw_file_io_list.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/socket.beam
Binary file not shown.
Binary file modified bootstrap/lib/kernel/ebin/wrap_log_reader.beam
Binary file not shown.
40 changes: 1 addition & 39 deletions bootstrap/lib/kernel/include/file.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,8 @@
-define(FILE_HRL_, 1).
%%--------------------------------------------------------------------------

-record(file_info,
{size :: non_neg_integer() | 'undefined', % Size of file in bytes.
type :: 'device' | 'directory' | 'other' | 'regular' | 'symlink'
| 'undefined',
access :: 'read' | 'write' | 'read_write' | 'none' | 'undefined',
atime :: file:date_time() | non_neg_integer() | 'undefined',
% 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() | 'undefined',
% The local time the file was last written.
ctime :: file:date_time() | non_neg_integer() | 'undefined',
% 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() | 'undefined',
% File permissions. On Windows,
% the owner permissions will be
% duplicated for group and user.
links :: non_neg_integer() | 'undefined',
% Number of links to the file (1 if the
% filesystem doesn't support links).
major_device :: non_neg_integer() | 'undefined',
% 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() | 'undefined',
% Only valid for devices.
inode :: non_neg_integer() | 'undefined', % Inode number for file.
uid :: non_neg_integer() | 'undefined', % User id for owner.
gid :: non_neg_integer() | 'undefined'}). % Group id for owner.
-import_record(file, [file_info, file_descriptor]).


-record(file_descriptor,
{module :: module(), % Module that handles this kind of file
data :: term()}). % Module dependent data

%%--------------------------------------------------------------------------
-endif.
Binary file modified bootstrap/lib/stdlib/ebin/epp.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/erl_compile.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/erl_tar.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/file_sorter.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/filelib.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/filename.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/shell.beam
Binary file not shown.
Binary file modified bootstrap/lib/stdlib/ebin/zip.beam
Binary file not shown.
Binary file modified erts/preloaded/ebin/erl_prim_loader.beam
Binary file not shown.
Binary file modified erts/preloaded/ebin/init.beam
Binary file not shown.
Binary file modified erts/preloaded/ebin/prim_file.beam
Binary file not shown.
Binary file modified erts/preloaded/ebin/prim_zip.beam
Binary file not shown.
3 changes: 3 additions & 0 deletions erts/preloaded/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,8 @@ dialyzer: $(DIA_PLT)
../ebin \
$(DIA_WARNINGS) \
--verbose

ifneq ($(filter $(APP_TARGET),$(MAKECMDGOALS)),$(APP_TARGET))
DEP_REL_TOP=../../../lib/
include $(ERL_TOP)/make/dep.mk
endif
4 changes: 2 additions & 2 deletions erts/preloaded/src/erl_prim_loader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The `erl_prim_loader` module interprets the following command-line flags:
%% Used by init and the code server
-export([get_modules/2, is_basename/1]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-type host() :: atom().

Expand Down Expand Up @@ -305,7 +305,7 @@ record [`file_info`](`t:file:file_info/0`), defined in the Kernel include file
function is called:

```erlang
-include_lib("kernel/include/file.hrl").
-include("file.hrl").
```

For more information about the record see `file:read_file_info/2`.
Expand Down
2 changes: 1 addition & 1 deletion erts/preloaded/src/init.erl
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ error
objfile_extension/0, archive_extension/0,code_path_choice/0,
get_configfd/1, set_configfd/2]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-doc "Current status of init.".
-type internal_status() :: 'starting' | 'started' | 'stopping'.
Expand Down
10 changes: 9 additions & 1 deletion erts/preloaded/src/prim_file.erl
Original file line number Diff line number Diff line change
Expand Up @@ -674,12 +674,20 @@ read_handle_info_1(Fd, TimeType) ->
#{ handle := FRef } = get_fd_data(Fd),
case read_handle_info_nif(FRef) of
{error, Reason} -> {error, Reason};
FileInfo -> {ok, adjust_times(FileInfo, TimeType)}
FileInfo ->
{ok, adjust_times(FileInfo, TimeType)}
end
catch
error:_ -> {error, badarg}
end.

adjust_times({file_info, S, T, A, AT, MT, CT, M, L,
MAD, MID, I, U, G}, TimeType) ->
adjust_times(#file_info{size = S, type = T, access = A,
atime = AT, mtime = MT, ctime = CT,
mode = M, links = L,
major_device = MAD, minor_device = MID, inode = I,
uid = U, gid = G}, TimeType);
Comment on lines +684 to +690

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (bug_risk): The new #file_info construction requires the record definition to be visible in prim_file.

This clause now uses the #file_info{} record, but prim_file.erl doesn’t appear to include its definition (previously it only handled the tuple/map from the NIF). Without something like -include("file.hrl"). (or equivalent) the module won’t compile. Please make the record definition available here, consistent with other callers of #file_info{}.

adjust_times(FileInfo, posix) ->
FileInfo;
adjust_times(FileInfo, TimeType) ->
Expand Down
2 changes: 1 addition & 1 deletion erts/preloaded/src/prim_zip.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
-export([splitter/3]).

%% includes
-include_lib("kernel/include/file.hrl"). % #file_info
-include("file.hrl"). % #file_info
-include_lib("stdlib/include/zip.hrl"). % #zip_file, #zip_comment
-include("zip_internal.hrl"). % #cd_file_header etc

Expand Down
1 change: 1 addition & 0 deletions lib/asn1/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ EXAMPLES = \

ERL_COMPILE_FLAGS += \
-I$(ERL_TOP)/lib/stdlib \
-I../../kernel/include \
-Werror +nowarn_deprecated_catch

ifeq ($(ERL_DETERMINISTIC),yes)
Expand Down
2 changes: 1 addition & 1 deletion lib/asn1/src/asn1ct.erl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ASN.1 data (encoded as `BER` or `PER`).

-include("asn1_records.hrl").
-include_lib("stdlib/include/erl_compile.hrl").
-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-ifndef(vsn).
-define(vsn,"0.0.1").
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/ct_cover.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ This module exports help functions for performing code coverage analysis.

-include("ct_util.hrl").

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-doc """
Adds nodes to current cover test. Notice that this only works if cover support
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/ct_logs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
-include("ct.hrl").
-include("ct_event.hrl").
-include("ct_util.hrl").
-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-define(suitelog_name,"suite.log").
-define(run_summary, "suite.summary").
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/ct_make.erl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

-export([all/0,all/1,files/1,files/2]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-define(MakeOpts,[noexec,load,netload,noload]).

Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/ct_release_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@

-export([init/1, upgrade/4, cleanup/1, get_app_vsns/2, get_appup/2]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

%%-----------------------------------------------------------------
-define(testnode, 'ct_release_test-upgrade').
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/test_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-include("test_server_internal.hrl").
-include_lib("kernel/include/file.hrl").
-include("file.hrl").


init_target_info() ->
Expand Down
2 changes: 1 addition & 1 deletion lib/common_test/src/test_server_ctrl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

-include("test_server_internal.hrl").
-include_lib("kernel/include/file.hrl").
-include("file.hrl").
-define(suite_ext, "_SUITE").
-define(log_ext, ".log.html").
-define(src_listing_ext, ".src.html").
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE)
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
ERL_COMPILE_FLAGS += -Werror -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin +nowarn_deprecated_catch
ERL_COMPILE_FLAGS += -Werror -I $(ERL_TOP)/lib -I../../kernel/include -pa $(ERL_TOP)/lib/wx/ebin +nowarn_deprecated_catch


# ----------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/src/dbg_wx_interpret.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
-module(dbg_wx_interpret).
-moduledoc false.

-include_lib("kernel/include/file.hrl").
-include("file.hrl").
-include_lib("wx/include/wx.hrl").

%% External exports
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/src/dbg_wx_mon.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
-module(dbg_wx_mon).
-moduledoc false.

-include_lib("kernel/include/file.hrl").
-include("file.hrl").
-include_lib("wx/include/wx.hrl").

%% External exports
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/src/dbg_wx_settings.erl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
-module(dbg_wx_settings).
-moduledoc false.

-include_lib("kernel/include/file.hrl").
-include("file.hrl").
-include_lib("wx/include/wx.hrl").

%% External exports
Expand Down
2 changes: 1 addition & 1 deletion lib/debugger/src/int.erl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ in the User's Guide for Debugger.
%% External export only to be used by error_handler
-export([eval/3]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

%%==Erlang Interpreter================================================
%%
Expand Down
1 change: 1 addition & 0 deletions lib/dialyzer/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
# FLAGS
# ----------------------------------------------------

ERL_COMPILE_FLAGS += -I../../kernel/include
ERL_COMPILE_FLAGS += -Werror
ERL_COMPILE_FLAGS += +warn_export_vars +warn_unused_import +warn_missing_spec +warn_obsolete_bool_op

Expand Down
2 changes: 1 addition & 1 deletion lib/dialyzer/src/dialyzer_cl.erl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
start_report_modules_changed_and_analyzed/1]).

-include("dialyzer.hrl").
-include_lib("kernel/include/file.hrl"). % needed for #file_info{}
-include("file.hrl"). % needed for #file_info{}

-record(cl_state,
{backend_pid :: pid() | 'undefined',
Expand Down
2 changes: 1 addition & 1 deletion lib/dialyzer/src/dialyzer_incremental.erl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-export([start/1, start_report_modules_analyzed/1, start_report_modules_changed_and_analyzed/1]).

-include("dialyzer.hrl").
-include_lib("kernel/include/file.hrl"). % needed for #file_info{}
-include("file.hrl"). % needed for #file_info{}

-record(incremental_state,
{backend_pid :: pid() | 'undefined',
Expand Down
2 changes: 1 addition & 1 deletion lib/eunit/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/eunit-$(VSN)
EBIN = ../ebin
INCLUDE=../include

ERL_COMPILE_FLAGS += -pa $(EBIN) -pa ../../stdlib/ebin -I$(INCLUDE) \
ERL_COMPILE_FLAGS += -pa $(EBIN) -pa ../../stdlib/ebin -I../../kernel/include -I$(INCLUDE) \
+warn_deprecated_catch +warn_obsolete_bool_op +warn_unused_import -Werror

PARSE_TRANSFORM = eunit_autoexport.erl
Expand Down
2 changes: 1 addition & 1 deletion lib/eunit/src/eunit_data.erl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
-include("eunit.hrl").
-include("eunit_internal.hrl").

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-export([iter_init/3, iter_next/1, iter_prev/1, iter_id/1,
enter_context/3, get_module_tests/2]).
Expand Down
2 changes: 1 addition & 1 deletion lib/ftp/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
# FLAGS
# ----------------------------------------------------
EXTRA_ERLC_FLAGS = +warn_unused_vars +nowarn_deprecated_catch
ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/kernel/src \
ERL_COMPILE_FLAGS += -I../../kernel/include -I$(ERL_TOP)/lib/kernel/src \
-pz $(EBIN) \
-pz $(ERL_TOP)/lib/public_key/ebin \
$(EXTRA_ERLC_FLAGS) -DVSN=\"$(VSN)\"
Expand Down
2 changes: 1 addition & 1 deletion lib/ftp/src/ftp_progress.erl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
%% Spawn export
-export([init/1]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-record(progress, {
file :: string() | 'undefined',
Expand Down
40 changes: 1 addition & 39 deletions lib/kernel/include/file.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,8 @@
-define(FILE_HRL_, 1).
%%--------------------------------------------------------------------------

-record(file_info,
{size :: non_neg_integer() | 'undefined', % Size of file in bytes.
type :: 'device' | 'directory' | 'other' | 'regular' | 'symlink'
| 'undefined',
access :: 'read' | 'write' | 'read_write' | 'none' | 'undefined',
atime :: file:date_time() | non_neg_integer() | 'undefined',
% 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() | 'undefined',
% The local time the file was last written.
ctime :: file:date_time() | non_neg_integer() | 'undefined',
% 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() | 'undefined',
% File permissions. On Windows,
% the owner permissions will be
% duplicated for group and user.
links :: non_neg_integer() | 'undefined',
% Number of links to the file (1 if the
% filesystem doesn't support links).
major_device :: non_neg_integer() | 'undefined',
% 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() | 'undefined',
% Only valid for devices.
inode :: non_neg_integer() | 'undefined', % Inode number for file.
uid :: non_neg_integer() | 'undefined', % User id for owner.
gid :: non_neg_integer() | 'undefined'}). % Group id for owner.
-import_record(file, [file_info, file_descriptor]).


-record(file_descriptor,
{module :: module(), % Module that handles this kind of file
data :: term()}). % Module dependent data

%%--------------------------------------------------------------------------
-endif.
2 changes: 1 addition & 1 deletion lib/kernel/src/auth.erl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Manual.
}).
-type state() :: #state{}.

-include_lib("kernel/include/file.hrl").
-include("file.hrl").

%%----------------------------------------------------------------------
%% Exported functions
Expand Down
2 changes: 1 addition & 1 deletion lib/kernel/src/code.erl
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ common reasons.
-export_type([load_error_rsn/0, load_ret/0]).
-export_type([prepared_code/0]).
-export_type([module_status/0]).
-include_lib("kernel/include/file.hrl").
-include("file.hrl").

-export_type([coverage_mode/0]).
-type coverage_mode() :: 'none' | 'function' | 'function_counters' |
Expand Down
2 changes: 1 addition & 1 deletion lib/kernel/src/code_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
error_msg/2, info_msg/2
]).

-include_lib("kernel/include/file.hrl").
-include("file.hrl").
-include_lib("stdlib/include/ms_transform.hrl").

-import(lists, [foreach/2]).
Expand Down
Loading
Loading