Skip to content

Commit

Permalink
doc: add compat for mktemp and mktempdir docstrings (#38452)
Browse files Browse the repository at this point in the history
  • Loading branch information
mortenpi authored Nov 30, 2020
1 parent 95d5fba commit bc94c50
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ tempname()
Return `(path, io)`, where `path` is the path of a new temporary file in `parent`
and `io` is an open file object for this path. The `cleanup` option controls whether
the temporary file is automatically deleted when the process exits.
!!! compat "Julia 1.3"
The `cleanup` keyword argument was added in Julia 1.3. Relatedly, starting from 1.3,
Julia will remove the temporary paths created by `mktemp` when the Julia process exits,
unless `cleanup` is explicitly set to `false`.
"""
mktemp(parent)

Expand All @@ -649,6 +654,14 @@ constructed from the given prefix and a random suffix, and return its path.
Additionally, any trailing `X` characters may be replaced with random characters.
If `parent` does not exist, throw an error. The `cleanup` option controls whether
the temporary directory is automatically deleted when the process exits.
!!! compat "Julia 1.2"
The `prefix` keyword argument was added in Julia 1.2.
!!! compat "Julia 1.3"
The `cleanup` keyword argument was added in Julia 1.3. Relatedly, starting from 1.3,
Julia will remove the temporary paths created by `mktempdir` when the Julia process
exits, unless `cleanup` is explicitly set to `false`.
"""
function mktempdir(parent::AbstractString=tempdir();
prefix::AbstractString=temp_prefix, cleanup::Bool=true)
Expand Down Expand Up @@ -705,6 +718,9 @@ end
Apply the function `f` to the result of [`mktempdir(parent; prefix)`](@ref) and remove the
temporary directory all of its contents upon completion.
!!! compat "Julia 1.2"
The `prefix` keyword argument was added in Julia 1.2.
"""
function mktempdir(fn::Function, parent::AbstractString=tempdir();
prefix::AbstractString=temp_prefix)
Expand Down

0 comments on commit bc94c50

Please sign in to comment.