diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..fb9ea13 --- /dev/null +++ b/build.sh @@ -0,0 +1,2 @@ +#!/bin/sh +rdmd --build-only -ofdub -g -debug -Isource -L-lcurl $* source/app.d diff --git a/source/vibe/core/file.d b/source/vibe/core/file.d index 7e660e8..dc7db3b 100644 --- a/source/vibe/core/file.d +++ b/source/vibe/core/file.d @@ -85,6 +85,7 @@ logDebug("tmp %s", tmpname); return openFile(tmpname, FileMode.CreateTrunc); } else { + import core.sys.posix.stdio; enum pattern ="/tmp/vtmp.XXXXXX"; scope templ = new char[pattern.length+suffix.length+1]; templ[0 .. pattern.length] = pattern; @@ -93,7 +94,8 @@ assert(suffix.length <= int.max); auto fd = mkstemps(templ.ptr, cast(int)suffix.length); enforce(fd >= 0, "Failed to create temporary file."); - return File.wrapFile(fdopen(fd)); + auto ret = File.wrapFile(fdopen(fd, "wb+")); + return RangeFile(ret); } }