Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mktempdir() now supports prefix. #23237

Closed
wants to merge 406 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
406 commits
Select commit Hold shift + click to select a range
5a002bf
Doc checkout methods and type (#23410)
kshyatt Aug 24, 2017
2767355
REPL: fix newline indentation when point before 1st non-space (#23402)
rfourquet Aug 24, 2017
0f4baee
fix prompt-indentation when bracket pasting (#23406)
rfourquet Aug 24, 2017
92f70e2
Make --quiet and --banner independent (fix #23380)
StefanKarpinski Aug 22, 2017
aa3d2be
Int constructor instead of div for Int returns in gmp (#23329)
musm Aug 24, 2017
03c5d7d
deprecate expm in favor of exp (#23233)
Sacha0 Aug 24, 2017
8809617
Doc-strings for some internals. (#23333)
mschauer Aug 24, 2017
50e7208
Document merge base and GitAnnotated
kshyatt Aug 24, 2017
b92e612
Add docs for transact
kshyatt Aug 24, 2017
2406b6e
Unify the method name to get library versions (#23323)
musm Aug 24, 2017
5e8eecd
Add more information for CherrypickOptions
kshyatt Aug 24, 2017
b46c74c
Preserve the input element type in unique (#23208)
ararslan Aug 24, 2017
9ab6aca
REPL: implement Alt-{u,c,l} to change the case of the next word (#23379)
rfourquet Aug 25, 2017
6922ce8
Misc remove `&x` ccall syntax (#23301)
musm Aug 25, 2017
c44461a
Use iszero and isone in MPFR (#23322)
musm Aug 25, 2017
ceeb591
Merge pull request #22594 from JuliaLang/tb/optpasses_tm
maleadt Aug 25, 2017
daa5575
Disable globbing for curl download (#23254)
0x47 Aug 25, 2017
9944d3d
[DOC] Document Void type (#23324)
iglpdc Aug 25, 2017
90a3300
Use refs instead of Vector in Lapack (#23419)
musm Aug 25, 2017
4d4b9ce
fix #23430, counter overflow in subtyping
JeffBezanson Aug 25, 2017
706e720
Add docs for GitRevWalker and push_head! (#22654)
kshyatt Aug 25, 2017
2301d70
restrict `Bool` `*` methods to `AbstractFloat`, avoiding some ambigui…
JeffBezanson Aug 24, 2017
14d0b4a
Merge pull request #23412 from JuliaLang/cv/env-get
omus Aug 25, 2017
03660a4
Merge pull request #23399 from JuliaLang/sk/quieter
StefanKarpinski Aug 25, 2017
d9b7850
Merge pull request #23411 from JuliaLang/jb/parseable
JeffBezanson Aug 25, 2017
11aeba3
allocate fresh bindings on each iteration of `while` loops
JeffBezanson Aug 22, 2017
f82fc0f
Doc rebase stuff (#23432)
kshyatt Aug 25, 2017
149d108
Merge pull request #23437 from JuliaLang/ksh/docmerge2
kshyatt Aug 25, 2017
8c49303
fix PR #23399 accidentally turning off banner
StefanKarpinski Aug 25, 2017
c301095
Merge pull request #23439 from JuliaLang/ksh/doccpo
kshyatt Aug 25, 2017
9b3b2ff
Merge pull request #23438 from JuliaLang/ksh/doctransact
kshyatt Aug 25, 2017
182336d
Docs for libgit2 utils
kshyatt Aug 25, 2017
62d8671
Docs for a bunch of git blame stuff
kshyatt Aug 25, 2017
7754b61
Doc status opts and fix a typo
kshyatt Aug 26, 2017
6347dbd
Describe how to hack Base more easily with Revise.jl
timholy Aug 26, 2017
0d95a1f
fix printing expressions like Ref{<:Real}
visr Aug 26, 2017
119cf4c
Remove `&x` convention in ccall in gmp (#23289)
musm Aug 26, 2017
991e26a
Merge pull request #23453 from JuliaLang/sk/banner
StefanKarpinski Aug 26, 2017
299aa48
Merge pull request #23444 from 0x47/curl_globbing
StefanKarpinski Aug 26, 2017
fc6b0ef
Remove `&x` convention in ccall in mpfr (#23288)
musm Aug 26, 2017
9f61878
Make sure error from `Expr(:new)` is not optimized away. (#23353)
yuyichao Aug 26, 2017
ab0ac5e
fix a typo in a docstring (#23466)
bicycle1885 Aug 26, 2017
fd06baa
Update conditional documentation example
Keno Aug 26, 2017
b510714
inference: use TypedSlot to mark intermediate load types
vtjnash Aug 26, 2017
de7b893
inference: ensure NewvarNode side-effect is handled
vtjnash Aug 26, 2017
e89d150
update libuv (#23326)
vtjnash Aug 26, 2017
3588102
Rename select* functions to partialsort*
nalimilan Jul 31, 2017
8150f66
Make partialsort!() and partialsortperm!() return a view rather than …
nalimilan Jul 31, 2017
7a54a2f
Fix docstrings for partialsortperm() and partialsortperm!()
nalimilan Aug 25, 2017
a059bd7
Merge pull request #23446 from JuliaLang/teh/revise
timholy Aug 27, 2017
f6e0fca
Merge pull request #23455 from JuliaLang/ksh/docblame
kshyatt Aug 27, 2017
6ad3f6e
Merge pull request #23458 from JuliaLang/ksh/docstatus
kshyatt Aug 27, 2017
e6dcc49
Merge pull request #23454 from JuliaLang/ksh/docutils
kshyatt Aug 27, 2017
27aff73
Merge pull request #23467 from JuliaLang/kf/docexample
Keno Aug 27, 2017
77c2439
Even more docs (#23420)
kshyatt Aug 27, 2017
e545c65
Doc merge_analysis and some enums (#23435)
kshyatt Aug 27, 2017
c5d5e9a
Merge pull request #23051 from JuliaLang/nl/select
nalimilan Aug 27, 2017
9f00d84
Add docs for git oid methods (#23460)
ararslan Aug 27, 2017
9ac2b57
Merge pull request #23464 from visr/printsugar
JeffBezanson Aug 28, 2017
e134a36
fix bug in showing `UnionAll` introduced by #23411
JeffBezanson Aug 28, 2017
f9527b7
fix bug in printing generator expressions with n-d ranges
JeffBezanson Aug 28, 2017
df9be70
Merge pull request #23479 from JuliaLang/jb/showUnionAll
JeffBezanson Aug 28, 2017
0c10166
Merge pull request #23480 from JuliaLang/jb/showgenerator
JeffBezanson Aug 28, 2017
5b12051
Merge pull request #23447 from JuliaLang/jb/fix23430
JeffBezanson Aug 28, 2017
ff706aa
Merge pull request #23470 from JuliaLang/jn/var-infer
vtjnash Aug 28, 2017
869112d
Fix deprecations
femtocleaner[bot] Aug 28, 2017
05037f5
Merge pull request #23433 from JuliaLang/jb/boolmul
JeffBezanson Aug 28, 2017
144c46b
Make describe docs more accurate/informative (#23477)
kshyatt Aug 28, 2017
6ff8d13
Doc SigStruct and DescribeOptions
kshyatt Aug 27, 2017
a48a7d2
fix missing propagate_inbounds from ordering comparison
vtjnash Aug 28, 2017
d9dde5d
revise boundscheck structure
vtjnash Jun 28, 2017
e5c6402
Merge pull request #23476 from JuliaLang/ksh/docdoc
kshyatt Aug 29, 2017
9db5eeb
Update README.md (#21326)
saharjs Aug 29, 2017
5645fb2
rm ubuntu nightly ppa as not actively maintained (#23484)
xgdgsc Aug 29, 2017
3f91250
Add missing datatype_module method for UnionAll types
quinnj Aug 29, 2017
89772d4
fix some convert methods that depwarned (#23494)
fredrikekre Aug 29, 2017
6a47db8
Fix 22577. Add string macros to REPLCompletion. (#23119)
dhoegh Aug 29, 2017
4d8f616
Make printing of big(NaN) consistent (#23382)
jw3126 Aug 22, 2017
7d60a81
More compact BigFloat printing (#23382)
jw3126 Aug 23, 2017
36990c7
Deprecate countnz in favor of using count(predicate, x) (#23485)
andreasnoack Aug 29, 2017
46bff1b
test-codegen: make jl_dump_compiles test more reliable (#23486)
vtjnash Aug 29, 2017
99c8407
Add propagate_inbounds for LogicalIndex iteration
mbauman Aug 29, 2017
9089b13
Merge pull request #23440 from JuliaLang/fbot/deps
Keno Aug 29, 2017
15fb3db
Added notes on closing a library. (#23489)
tuckermcclure Aug 29, 2017
109b0b4
Doc warn and warn_with (#23441)
kshyatt Aug 29, 2017
d8e5b96
fix GC rooting of arguments in cfunction `_gfthunk` wrappers
JeffBezanson Aug 29, 2017
8522ff0
deprecate `catch <expression>`. addresses #19987
JeffBezanson Aug 28, 2017
709a639
fix `promote_rule` for `Bidiagonal` and `Tridiagonal`
JeffBezanson Aug 29, 2017
3573522
Merge pull request #23397 from JuliaLang/jb/whilescope
JeffBezanson Aug 29, 2017
1c75a4d
Finish docs for GitTree (#23451)
kshyatt Aug 29, 2017
9454cd4
Remove global const in init in cholmod (#23449)
musm Aug 29, 2017
90c91e3
test/file: try to fix freezing of test_22566 (#23001)
iblislin Aug 29, 2017
881ab49
More docs for merge! (#23495)
kshyatt Aug 29, 2017
e07eabb
Merge pull request #23501 from JuliaLang/jb/gfthunk_roots
JeffBezanson Aug 30, 2017
c3f5917
Merge pull request #23487 from JuliaLang/jb/catchexpr
JeffBezanson Aug 30, 2017
644c53c
Merge pull request #23503 from JuliaLang/jb/bidiag_promote
JeffBezanson Aug 30, 2017
e9ab77d
fix #23107, ensure `Array` constructor always makes new arrays
JeffBezanson Aug 28, 2017
7f1623e
Fix `countnz` deprecation (#23509)
martinholters Aug 30, 2017
00e2075
Make partial_inst a global root. (#23507)
yuyichao Aug 30, 2017
b104cee
Fix off-by-one error in string reallocation (#23493)
mbauman Aug 30, 2017
3cb9eb9
Fix expanduser with empty string (#23506)
omus Aug 30, 2017
b9ce52f
make `promote` throw an error if no arguments can be changed. fixes #…
JeffBezanson Aug 14, 2017
afa6af1
implement #6614, destructuring in formal arguments
JeffBezanson Aug 18, 2017
488febc
Completely remove partial linear indexing (#21750)
mbauman Aug 30, 2017
440b18d
Merge pull request #22826 from JuliaLang/jn/boundscheck-revised
mbauman Aug 30, 2017
9c6e496
Merge pull request #23490 from JuliaLang/jb/Arrayctor
JeffBezanson Aug 30, 2017
a969c2a
fix promotion of diagonal integer matrix to non-integer power (#23510)
fredrikekre Aug 30, 2017
104a81c
Doc statusentry and add xrefs
kshyatt Aug 30, 2017
f4bb1ba
Document boundscheck macro
mbauman Aug 30, 2017
09f727e
Add test for issue #20469
mbauman Aug 30, 2017
ecf284d
Merge pull request #23337 from JuliaLang/jb/arg_destructuring
JeffBezanson Aug 31, 2017
7e35ac6
Merge pull request #23491 from JuliaLang/jb/noncircular_promote
JeffBezanson Aug 31, 2017
9d6c9bd
Update to latest curl, mbedtls, and pcre (#23498)
tkelman Aug 31, 2017
8f6f5aa
move mathematical constants to Base.MathConstants (#23427)
fredrikekre Aug 31, 2017
88b6487
Merge pull request #23517 from JuliaLang/ksh/docstatus
kshyatt Aug 31, 2017
6210e24
make findmin/findmax behavior match min/max (fix #23209) (#23227)
KlausC Aug 31, 2017
c64a6cc
Deprecate rol and ror in favor of circshift methods (#23404)
ararslan Aug 31, 2017
383b919
Deprecate logm in favor of log. (#23505)
Sacha0 Aug 31, 2017
b729e58
fix documentation for IOBuffer, close #23398 (#23514)
fredrikekre Aug 31, 2017
44fe78c
Deprecate sqrtm in favor of sqrt. (#23504)
Sacha0 Aug 31, 2017
e0ca7d0
Add docs for internal commit method
kshyatt Sep 1, 2017
99173bb
clarification about ℯ (#23534)
fredrikekre Sep 1, 2017
bad1329
Merge pull request #23538 from JuliaLang/ksh/doccommit
kshyatt Sep 1, 2017
917e8af
Add field docs for Diffopts
kshyatt Sep 1, 2017
e564008
deprecate `&x` in ccall. fixes #6080
JeffBezanson Sep 1, 2017
d4a5553
Cleaned up default descriptions in reflection.jl (#23543)
Sep 1, 2017
fc54dc4
update rationalize docs (#23541)
Sep 1, 2017
a848012
fix StackOverflowError in symdiff(::IntSet, ::NotInteger)
rfourquet Sep 2, 2017
43ced35
more about type annotation (#23180)
StephenVavasis Sep 2, 2017
6792ad5
fix IntSet tests invalid since #23138
rfourquet Sep 2, 2017
aee1aab
fix #23558, bug in recursive let-bound functions
JeffBezanson Sep 2, 2017
92ff781
faster sparse(::Diagonal) (#23536)
fredrikekre Sep 2, 2017
45b0013
Makes sure assertion respects JL_NDEBUG in C++ code
yuyichao Sep 2, 2017
b8536bf
Use min(size(A)...) instead of max(size(A)...) when computing the num…
andreasnoack Sep 2, 2017
9edfa55
Merge pull request #23559 from JuliaLang/rf/fix-intset-test
JeffBezanson Sep 2, 2017
3c68dcd
Don't ignore memcpy in GC root placement
Keno Sep 2, 2017
6a1e339
Merge pull request #23563 from JuliaLang/yyc/build/assert
Keno Sep 2, 2017
797e87b
Add gc use intrinisic
Keno Sep 2, 2017
61ee70d
Remove some leagcy gcroot codegen code
Keno Sep 3, 2017
dd7feae
REPL: free-up '\0' as a key (sent by Ctrl-Space)
rfourquet Aug 20, 2017
adae830
REPL: add few "region" operations
rfourquet Aug 20, 2017
9cf7505
REPL: register previous run action as symbol
rfourquet Aug 19, 2017
c2cbef2
REPL: implement a kill ring (fix part of #8447)
rfourquet Aug 20, 2017
2d962c1
REPL: specify regions with open-close ranges using Pairs
rfourquet Aug 20, 2017
8422d50
REPL: add tests for the kill ring
rfourquet Aug 24, 2017
f5b96f7
Merge pull request #23377 from JuliaLang/rf/REPL-killring
rfourquet Sep 3, 2017
81b839d
re-enable the 0-arg MersenneTwister() constructor
rfourquet May 14, 2017
f4edae1
Merge pull request #21909 from JuliaLang/rf/MT-ctor
rfourquet Sep 3, 2017
9cdec25
Merge pull request #23564 from JuliaLang/kf/gcmemcpy
Keno Sep 3, 2017
7e2e6c9
Merge pull request #23562 from JuliaLang/kf/gcuse
Keno Sep 3, 2017
d0bae2b
Merge pull request #23557 from JuliaLang/rf/IntSet-symdiff-overflow
JeffBezanson Sep 3, 2017
2e6d908
Merge pull request #23561 from JuliaLang/jb/fix23558
JeffBezanson Sep 3, 2017
22ea732
Merge pull request #23568 from JuliaLang/kf/legacygc
Keno Sep 3, 2017
d11a235
Merge pull request #23554 from JuliaLang/ksh/docdiffopts
kshyatt Sep 3, 2017
ec601e9
Correct indentation for LibGit2.Consts
omus Sep 3, 2017
e2a4c72
Fix GIT_CONFIG docstring
omus Aug 28, 2017
e235f65
Fix GIT_OPT indentation
omus Sep 3, 2017
75ec2b9
Merge pull request #23388 from jw3126/big
StefanKarpinski Sep 4, 2017
a3de583
Fix #23567. In general, we need to be careful when we start branching…
quinnj Sep 4, 2017
c73da15
Remove incorrect code from jl_array_ptr_copy for isbits Union arrays
quinnj Sep 4, 2017
063f0f8
Update unsafe_convert for isbits Unions according to recommendation f…
quinnj Sep 4, 2017
54a2b01
Unify function references in docs (#23535)
fredrikekre Sep 4, 2017
fdef237
Merge pull request #23555 from JuliaLang/jb/ampersand
JeffBezanson Sep 4, 2017
e2ea895
add `pairs`, and `keys`/`values` for arrays
JeffBezanson Jul 21, 2017
ef2fd5f
use `pairs` in `findmin` and `findmax`, supporting all indexable coll…
JeffBezanson Jul 21, 2017
447ca30
Add a trailing newline to the & deprecation message
ararslan Sep 4, 2017
dbd1574
parse `let` the same as `for`. part of #21774
JeffBezanson Sep 1, 2017
e0658f2
Fix deprecated & syntax in MPFR ccalls
ararslan Sep 4, 2017
47986fa
Add a codegen param for preferring specsig.
maleadt Sep 3, 2017
5c6f423
Embed codegen hooks in the params object.
maleadt Sep 4, 2017
dc4f140
Untangle legacy .gcroot field
Keno Sep 3, 2017
4f8a612
`unsafe_load` -> `@inbounds codeunit`
Keno Sep 4, 2017
4c0a3e6
Probably due to #23397; ensure the istart variable is declared outsid…
quinnj Sep 5, 2017
ff59aad
Merge pull request #23577 from JuliaLang/jq/bitsunionarrays
quinnj Sep 5, 2017
10ae1b9
Merge pull request #23496 from JuliaLang/jq/refl
quinnj Sep 5, 2017
7b6a554
Untangle legacy .gcroot field
Keno Sep 3, 2017
b83b7e9
Work to ensure immutable isbits Union fields get set correctly. #23351
quinnj Aug 20, 2017
560aca9
correctly handle union-splitting in codegen type allocation
vtjnash Aug 22, 2017
a562e33
Add tests for structs with isbits Union fields.
quinnj Aug 23, 2017
f61db81
correctly handle union-store-splitting in "is" and "object_id"
vtjnash Aug 23, 2017
2bb430e
fix codegen bugs, simplify type representations
vtjnash Aug 24, 2017
890080f
Merge pull request #23580 from JuliaLang/aa/ref-dep-fix
ararslan Sep 5, 2017
503a091
Switch Cygwin download links to https (#23578)
halleysfifthinc Sep 5, 2017
582ba82
remove mention of helpdb/Base.jl in CONTRIBUTING.md (#23587)
fredrikekre Sep 5, 2017
be83cac
REPL: Add ^P and ^N to modal prefix searching (#23319)
Sep 5, 2017
4502ee4
Add REPL completion for tilde paths (#23475)
HarrisonGrodin Sep 5, 2017
30530e0
remove vestigial Char in rand(::UnitRange{<:Union{..., Char}) (#23545)
rfourquet Sep 5, 2017
2526b40
Merge pull request #23584 from JuliaLang/jq/cartesian
quinnj Sep 5, 2017
a612851
Return GitError from credential_loop
omus Aug 26, 2017
10cf8a2
challenge_prompt now takes an expression
omus Aug 26, 2017
c31fdea
Remove cgparams that disallow language features.
maleadt Sep 4, 2017
0e1eb8b
Merge pull request #9596 from srp/repl-undo
rfourquet Sep 5, 2017
ac37603
REPL: enable undo in bracketed paste mode
rfourquet Aug 7, 2017
54b99d0
Merge pull request #22907 from JuliaLang/jb/keyvalue
JeffBezanson Sep 5, 2017
0f7ca71
add error message for attempting to capture a local variable as a clo…
vtjnash Sep 5, 2017
2a133fc
Merge pull request #23582 from JuliaLang/kf/codeunit
Keno Sep 5, 2017
bc68f48
Merge pull request #23571 from JuliaLang/kf/untanglegcroot
Keno Sep 5, 2017
8183c0f
Merge pull request #23581 from JuliaLang/tb/inflight
maleadt Sep 5, 2017
61e4a26
fix #15723, `findfirst` on strings
JeffBezanson Sep 5, 2017
2bdcd5f
Merge pull request #23553 from JuliaLang/jb/parselet
JeffBezanson Sep 5, 2017
f32499f
Merge pull request #23592 from JuliaLang/jb/fix15723
JeffBezanson Sep 6, 2017
7bb0d53
Exclude starting slash from path in URL_REGEX (#23574)
omus Sep 6, 2017
1ca3510
Display STDOUT from Pkg.build
omus Sep 6, 2017
508c9f5
fix boundscheck value propagation codegen bug (#23595)
jrevels Sep 6, 2017
d6c9902
inference: leaftype Type{typeof(Union{})} is ambiguous
vtjnash Sep 6, 2017
db80d86
invoke should raise MethodError for ambiguous cases
vtjnash Sep 6, 2017
e21f35a
fieldtype validation: disallow `Vararg` as a field type
vtjnash Sep 6, 2017
c5dff37
Merge pull request #23572 from JuliaLang/cv/libgit2-consts
omus Sep 6, 2017
10af910
Merge pull request #23602 from JuliaLang/jn/23413
JeffBezanson Sep 7, 2017
e05bd6b
Speed up isbitsunion and bitsunionsize functions
quinnj Sep 7, 2017
10ed407
LineEdit: add convenient default mode in `state` function
rfourquet Sep 5, 2017
5f708e8
REPL: enable "redo" after "undo"
rfourquet Sep 3, 2017
34df23e
REPL undo: fix edit_kill_region and add more tests
rfourquet Sep 7, 2017
1c0131c
Merge pull request #23601 from JuliaLang/cv/build-stdout
vchuravy Sep 7, 2017
1e7cc54
Merge pull request #23590 from JuliaLang/rf/repl-redo
rfourquet Sep 7, 2017
f569169
Merge pull request #23603 from JuliaLang/jn/18095
JeffBezanson Sep 7, 2017
ac148ce
Merge pull request #23604 from JuliaLang/jn/17951
JeffBezanson Sep 7, 2017
b83c228
make BigInt <: Signed (#23473)
rfourquet Sep 7, 2017
8052341
remove uses of `importall` in Base
JeffBezanson Sep 6, 2017
7e7300e
Merge pull request #23516 from JuliaLang/mb/docboundscheck
mbauman Sep 7, 2017
4d9b107
Merge pull request #23586 from JuliaLang/jq/bitsunionsperf
quinnj Sep 7, 2017
1875957
Merge pull request #23367 from JuliaLang/jq/bitsunions
quinnj Sep 7, 2017
caad8b2
Add a README note referencing FreeBSD Pkg segfaults (#23613)
ararslan Sep 7, 2017
4c8e693
Merge pull request #23573 from JuliaLang/cv/libgit2-helper-error
omus Sep 7, 2017
a06dbef
Add GPU support to the README. (#23623)
ViralBShah Sep 7, 2017
6d1680a
[RFC] Clean up test/tridiag (#23609)
kshyatt Sep 7, 2017
bc12af5
Merge pull request #23608 from JuliaLang/jb/no_importall
JeffBezanson Sep 7, 2017
22987e3
fix #19182: convert([Un]Signed, x::BigInt) (#23474)
rfourquet Sep 8, 2017
172f36e
REPL: more deleted words pushed into the kill ring (#23593)
rfourquet Sep 8, 2017
15b29bc
Remove string "Array" funnybusiness (#23583)
kshyatt Sep 8, 2017
45cf132
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
08c8579
Documentation error fix.
sambitdash Aug 13, 2017
8e12b60
OS specific test anomalies detected.
sambitdash Aug 13, 2017
edae2ec
A test error previously not reported fixed.
sambitdash Aug 21, 2017
328e099
Merge branch 'I22922' of https://github.com/sambitdash/julia into I22922
sambitdash Sep 8, 2017
2a81ce7
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
a7fe6fb
Documentation error fix.
sambitdash Aug 13, 2017
34b85e4
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
d33de07
Documentation error fix.
sambitdash Aug 13, 2017
0c13682
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
7ef0453
Documentation error fix.
sambitdash Aug 13, 2017
9ba55d5
OS specific test anomalies detected.
sambitdash Aug 13, 2017
4e9aa66
A test error previously not reported fixed.
sambitdash Aug 21, 2017
85aaf04
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
5e46435
Documentation error fix.
sambitdash Aug 13, 2017
cdc2557
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
ec07815
Documentation error fix.
sambitdash Aug 13, 2017
b77c048
mktempdir() now supports prefix.
sambitdash Aug 13, 2017
22c4149
Documentation error fix.
sambitdash Aug 13, 2017
7ab5498
Merge branch 'I22922' of https://github.com/sambitdash/julia into I22922
sambitdash Sep 8, 2017
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
71 changes: 38 additions & 33 deletions base/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ function touch(path::AbstractString)
end
end

const temp_prefix = "jl_"

if Sys.iswindows()

function tempdir()
Expand All @@ -265,12 +267,16 @@ function tempdir()
resize!(temppath,lentemppath)
return transcode(String, temppath)
end

tempname(uunique::UInt32=UInt32(0)) = tempname(tempdir(), uunique)
const temp_prefix = cwstring("jl_")

function tempname(temppath::AbstractString,uunique::UInt32)
tempp = cwstring(temppath)
temppfx = cwstring(temp_prefix)
tname = Vector{UInt16}(32767)
uunique = ccall(:GetTempFileNameW,stdcall,UInt32,(Ptr{UInt16},Ptr{UInt16},UInt32,Ptr{UInt16}), tempp,temp_prefix,uunique,tname)
uunique = ccall(:GetTempFileNameW,stdcall,UInt32,
(Ptr{UInt16}, Ptr{UInt16}, UInt32, Ptr{UInt16}),
tempp, temppfx, uunique, tname)
lentname = findfirst(tname,0)-1
if uunique == 0 || lentname <= 0
error("GetTempFileName failed: $(Libc.FormatMessage())")
Expand All @@ -284,22 +290,6 @@ function mktemp(parent=tempdir())
return (filename, Base.open(filename, "r+"))
end

function mktempdir(parent=tempdir())
seed::UInt32 = rand(UInt32)
while true
if (seed & typemax(UInt16)) == 0
seed += 1
end
filename = tempname(parent, seed)
ret = ccall(:_wmkdir, Int32, (Ptr{UInt16},), cwstring(filename))
if ret == 0
return filename
end
systemerror(:mktempdir, Libc.errno()!=Libc.EEXIST)
seed += 1
end
end

else # !windows
# Obtain a temporary filename.
function tempname()
Expand All @@ -322,13 +312,6 @@ function mktemp(parent=tempdir())
return (b, fdio(p, true))
end

# Create and return the name of a temporary directory
function mktempdir(parent=tempdir())
b = joinpath(parent, "tmpXXXXXX")
p = ccall(:mkdtemp, Cstring, (Cstring,), b)
systemerror(:mktempdir, p == C_NULL)
return unsafe_string(p)
end

end # os-test

Expand Down Expand Up @@ -356,12 +339,33 @@ is an open file object for this path.
mktemp(parent)

"""
mktempdir(parent=tempdir())
mktempdir(parent=tempdir(); prefix="$temp_prefix")

Create a temporary directory in the `parent` directory and return its path.
If `parent` does not exist, throw an error.
If `parent` does not exist, throw an error. An optional `prefix` to the directory name can
be provided.
"""
mktempdir(parent)
function mktempdir(parent=tempdir(); prefix="$temp_prefix")
template = prefix*"XXXXXX"
tpath = joinpath(parent, template)

req = Libc.malloc(_sizeof_uv_fs)
Copy link
Member

Choose a reason for hiding this comment

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

I see you use the same approach as for readlink, but readdir uses a different strategy, by using zeros, which allows skipping the try... finally. @vtjnash Which approach is recommended?

Copy link
Contributor Author

@sambitdash sambitdash Aug 23, 2017

Choose a reason for hiding this comment

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

I guess I now get the approach here. In jl_uv.c all request structures are allocated in stack (declared as local var) and passed on to the function in the c-layer. The cleanup is carried out on the address to the request like &req. In the Julia layer you cannot have a stack variable so zero is a means to create a Julia array{UInt8} which will be memory managed in the Julia layer. Hence, no special action on a throw and clean up will be called on this object after the request object is used in the ccall. The approach is a bit hard to understand initially. Are try...catch overheads very significant? I can change the code to the zero approach.

Copy link
Member

Choose a reason for hiding this comment

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

I would think the simplest approach is the best one, but others must know better.

try
ret = ccall(:uv_fs_mkdtemp, Int32,
(Ptr{Void}, Ptr{Void}, Cstring, Ptr{Void}),
Copy link
Member

Choose a reason for hiding this comment

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

Incorrect indentation.

Copy link
Contributor Author

@sambitdash sambitdash Aug 23, 2017

Choose a reason for hiding this comment

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

I followed the same indentation as readlink, although my personal preference would be to align to ccall.

+        ret = ccall(:uv_fs_mkdtemp, Int32,
+                    (Ptr{Void}, Ptr{Void}, Cstring, Ptr{Void}),

eventloop(), req, tpath, C_NULL)
if ret < 0
ccall(:uv_fs_req_cleanup, Void, (Ptr{Void},), req)
uv_error("mktempdir", ret)
assert(false)
end
path = unsafe_string(ccall(:jl_uv_fs_t_path, Ptr{Cchar}, (Ptr{Void},), req))
ccall(:uv_fs_req_cleanup, Void, (Ptr{Void},), req)
return path
finally
Libc.free(req)
end
end


"""
Expand All @@ -381,13 +385,14 @@ function mktemp(fn::Function, parent=tempdir())
end

"""
mktempdir(f::Function, parent=tempdir())
mktempdir(f::Function, parent=tempdir(); prefix="$temp_prefix")

Apply the function `f` to the result of [`mktempdir(parent)`](@ref) and remove the
temporary directory upon completion.
Apply the function `f` to the result of [`mktempdir(parent; prefix)`](@ref) and remove the
temporary directory upon completion. An optional `prefix` to the directory name can
be provided.
"""
function mktempdir(fn::Function, parent=tempdir())
tmpdir = mktempdir(parent)
function mktempdir(fn::Function, parent=tempdir(); prefix="$temp_prefix")
tmpdir = mktempdir(parent; prefix=prefix)
try
fn(tmpdir)
finally
Expand Down
1 change: 1 addition & 0 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ JL_DLLEXPORT int32_t jl_nb_available(ios_t *s)
JL_DLLEXPORT int jl_sizeof_uv_fs_t(void) { return sizeof(uv_fs_t); }
JL_DLLEXPORT void jl_uv_fs_req_cleanup(uv_fs_t *req) { uv_fs_req_cleanup(req); }
JL_DLLEXPORT char *jl_uv_fs_t_ptr(uv_fs_t *req) { return (char*)req->ptr; }
JL_DLLEXPORT char *jl_uv_fs_t_path(uv_fs_t *req) { return (char*)req->path; }
JL_DLLEXPORT int jl_uv_fs_result(uv_fs_t *f) { return f->result; }

// --- stat ---
Expand Down
43 changes: 43 additions & 0 deletions test/file.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1156,3 +1156,46 @@ if !Sys.iswindows()
test_22566()
end
end # !Sys.iswindows

function test_22922()
def_prefix = "jl_"
tst_prefix = "ABCDEF"
mktempdir() do tmpdir
filename = basename(tmpdir)
@test startswith(filename, def_prefix)
end
mktempdir(; prefix=tst_prefix) do tmpdir
filename = basename(tmpdir)
@test startswith(filename, tst_prefix)
end
# Special character prefix tests
tst_prefix="#!@%^&()"
mktempdir(; prefix=tst_prefix) do tmpdir
filename = basename(tmpdir)
@test startswith(filename, tst_prefix)
end

# Behavioral differences across OS types
if Sys.iswindows()
@test_throws Base.UVError mktempdir(; prefix="*")
@test_throws Base.UVError mktempdir(; prefix="cdcdccd/")
Copy link
Member

Choose a reason for hiding this comment

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

Does / without any characters before it also throw? What about \ or C:\?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Give me a couple of days. My windows VM is needs some fixing before I can test this. I am a native Linux programmer :-).

else
# '/' is accepted in a prefix but affects the overall path and permissions.
Copy link
Member

Choose a reason for hiding this comment

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

That comment sounds misleading, since / is not accepted by the next line.

Copy link
Contributor Author

@sambitdash sambitdash Aug 23, 2017

Choose a reason for hiding this comment

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

The whole behavior is very messy. I think we should just not accept '/' in prefix. Some samples:

julia> mktempdir("/";prefix="tmp/")
"/tmp/m12rZm"

julia> mktempdir("/tmp";prefix="/")
ERROR: mktempdir: permission denied (EACCES)
Stacktrace:
 [1] uv_error at ./libuv.jl:68 [inlined]
 [2] #mktempdir#12(::String, ::Function, ::String) at ./file.jl:359
 [3] (::Base.Filesystem.#kw##mktempdir)(::Array{Any,1}, ::Base.Filesystem.#mktempdir, ::String) at ./<missing>:0

Copy link
Member

Choose a reason for hiding this comment

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

I'm not too worried about this, as these behaviors make sense, but differences between OSes are annoying. What happens with \ on Windows?

@test_throws Base.UVError mktempdir(; prefix="/")

# The file created will be of format "/tmp/XXXXXX"
mktempdir("/"; prefix="tmp/") do tmpdir
filename = basename(tmpdir)
@test length(filename) == 6
end
end

# Unicode test
tst_prefix="\u2200x\u2203y"
Copy link
Member

Choose a reason for hiding this comment

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

Directly use the Unicode chars, that's clearer.

mktempdir(; prefix=tst_prefix) do tmpdir
filename = basename(tmpdir)
@test startswith(filename, tst_prefix)
end
end

test_22922()