Skip to content

Commit 4ed7085

Browse files
define isfile for ::Anonymous
1 parent e944469 commit 4ed7085

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/Mmap/src/Mmap.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Anonymous() = Anonymous("",false,true)
4545
Base.isopen(::Anonymous) = true
4646
Base.isreadable(::Anonymous) = true
4747
Base.iswritable(a::Anonymous) = !a.readonly
48+
Base.isfile(::Anonymous) = true
4849

4950
# const used for zeroed, anonymous memory
5051
gethandle(io::Anonymous) = INVALID_OS_HANDLE
@@ -87,7 +88,7 @@ function grow!(io::IO, offset::Integer, len::Integer)
8788
pos = position(io)
8889
filelen = filesize(io)
8990
# If non-regular file skip trying to grow since we know that will fail the ftruncate syscall
90-
filelen == 0 && !isfile(stat(io)) && return
91+
filelen == 0 && !isfile(io) && return
9192
if filelen < offset + len
9293
failure = ccall(:jl_ftruncate, Cint, (Cint, Int64), fd(io), offset+len)
9394
Base.systemerror(:ftruncate, failure != 0)

0 commit comments

Comments
 (0)