- Compiles and then purges and loads the code for a file.
- Options defaults to []. Compilation is
- equivalent to:
-
-compile:file(File, Options ++ [report_errors, report_warnings])
+ Compiles and then purges and loads the code for a module.
+ Module can be either a module name or a source
+ file path, with or without .erl extension.
+ Options defaults to [].
+ If Module is an atom and is not the path of a
+ source file, then the code path is searched to locate the object
+ file for the module and extract its original compiler options and
+ source path. If the source file is not found in the original
+ location, filelib:find_source/1
+ is used to search for it relative to the directory of the object
+ file.
+ The source file is compiled with the the original
+ options appended to the given Options, the
+ output replacing the old object file if and only if compilation
+ succeeds. A function Filter can be specified
+ for removing elements from from the original compiler options
+ before the new options are added.
Notice that purging the code means that any processes
lingering in old code for the module are killed without
warning. For more information, see code/3.
diff --git a/lib/stdlib/doc/src/shell.xml b/lib/stdlib/doc/src/shell.xml
index d6e8036d4e..f52bc39deb 100644
--- a/lib/stdlib/doc/src/shell.xml
+++ b/lib/stdlib/doc/src/shell.xml
@@ -165,12 +165,12 @@
-
Evaluates shell_default:help().
- c(File)
+ c(Mod)
-
-
Evaluates shell_default:c(File). This compiles
- and loads code in File and purges old versions of
- code, if necessary. Assumes that the file and module names
- are the same.
+ Evaluates shell_default:c(Mod). This compiles and
+ loads the module Mod and purges old versions of the
+ code, if necessary. Mod can be either a module name or a
+ a source file path, with or without .erl extension.
catch_exception(Bool)
-
--
cgit v1.2.3
From 1d886081027c4d4fcfbf7f73d4708694cad582f5 Mon Sep 17 00:00:00 2001
From: Richard Carlsson
Date: Sat, 4 Feb 2017 15:31:14 +0100
Subject: Deprecate filename:find_src/1/2
---
lib/stdlib/doc/src/filename.xml | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
(limited to 'lib/stdlib/doc/src')
diff --git a/lib/stdlib/doc/src/filename.xml b/lib/stdlib/doc/src/filename.xml
index 2a413835d0..7acef51ca1 100644
--- a/lib/stdlib/doc/src/filename.xml
+++ b/lib/stdlib/doc/src/filename.xml
@@ -356,10 +356,12 @@ true
Finds the source filename and compiler options for a module.
The result can be fed to
compile:file/2 to compile the file again.
- It is not recommended to use this function. If possible,
- use the beam_lib(3)
- module to extract the abstract code format from the Beam file and
- compile that instead.
+
+ This function is deprecated. Use
+ filelib:find_source/1 instead for finding source files.
+ If possible, use the beam_lib(3)
+ module to extract the compiler options and the abstract code
+ format from the Beam file and compile that instead.
Argument Beam, which can be a string or an atom,
specifies either the module name or the path to the source
code, with or without extension ".erl". In either
--
cgit v1.2.3