package coq
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=3cbfc1e1a72b16d4744f5b64ede59586071e31d9c11c811a0372060727bfd9c3
doc/coq-core.lib/System/index.html
Module System
Source
Coqtop specific system utilities
Directories
exclude_search_in_dirname path
excludes path
when processing directories
process_directory f path
applies f
on contents of directory path
; fails with Unix_error if the latter does not exists; skips all files or dirs starting with "."
process_subdirectories f path
applies f path/file file
on each file
of the directory path
; fails with Unix_error if the latter does not exists; kips all files or dirs starting with "."
Files and load paths
Load path entries remember the original root given by the user. For efficiency, we keep the full path (field directory
), the root path and the path relative to the root.
val find_file_in_path :
?warn:bool ->
CUnix.load_path ->
string ->
CUnix.physical_path * string
trust_file_cache
indicates whether we trust the underlying mapped file-system not to change along the execution of Coq. This assumption greatly speds up file search, but it is often inconvenient in interactive mode
I/O functions
Generic input and output functions, parameterized by a magic number and a suffix. The intern functions raise the exception Bad_magic_number
when the check fails, with the full file name and expected/observed magic numbers.
Clones of Marshal.to_channel (with flush) and Marshal.from_channel (with nice error message)
Time stamps.
get_toplevel_path program
builds a complete path to the executable denoted by program
. This involves:
- locating the directory: we don't rely on PATH as to make calls to /foo/bin/coqtop chose the right /foo/bin/coqproofworker
- adding the proper suffixes: .opt/.byte depending on the current mode, + .exe if in windows.
Note that this function doesn't check that the executable actually exists. This is left back to caller, as well as the choice of fallback strategy. We could add a fallback strategy here but it is better not to as in most cases if this function fails to construct the right name you want you execution to fail rather than fall into choosing some random binary from the system-wide installation of Coq.