import std.algorithm.iteration : map; import std.array : array; import std.range : iota; import std.stdio; immutable filename = fileId("blocksegment").fullpath; // writefln("filename=%s", filename); auto file = File(filename, "w"); scope (exit) { file.close; } file.rawWrite(iota(SMALL_BLOCK_SIZE).map!(i => cast(ubyte) i).array);