diff --git a/construct/core.py b/construct/core.py
index d2ec15e..785f4a0 100644
--- a/construct/core.py
+++ b/construct/core.py
@@ -351,7 +351,10 @@ class Construct(object):
         r"""
         Build an object into a closed binary file. See build().
         """
-        with open(filename, 'wb') as f:
+        # Open the file for reading as well as writing. This allows builders to
+        # read back the stream just written. For example. RawCopy does this.
+        # See issue #888.
+        with open(filename, 'w+b') as f:
             self.build_stream(obj, f, **contextkw)
 
     def _build(self, obj, stream, context, path):
diff --git a/construct/version.py b/construct/version.py
index b2c8dce..513a82f 100644
--- a/construct/version.py
+++ b/construct/version.py
@@ -1,3 +1,3 @@
-version = (2,10,56)
-version_string = "2.10.56"
-release_date = "2020.01.28"
+version = (2,10,57)
+version_string = "2.10.57"
+release_date = "2021.01.26"

diff --git a/tests/declarativeunittest.py b/tests/declarativeunittest.py
index d02a292..a39fb67 100644
--- a/tests/declarativeunittest.py
+++ b/tests/declarativeunittest.py
@@ -3,7 +3,7 @@ xfail = pytest.mark.xfail
 skip = pytest.mark.skip
 skipif = pytest.mark.skipif
 
-import os, math, random, collections, itertools, io, hashlib, binascii
+import os, math, random, collections, itertools, io, hashlib, binascii, tempfile
 
 from construct import *
 from construct.lib import *
diff --git a/tests/test_core.py b/tests/test_core.py
index 02e2e64..9da306c 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -930,6 +930,15 @@ def test_rawcopy_issue_358():
     d = Struct("a"/RawCopy(Byte), "check"/Check(this.a.value == 255))
     assert d.build(dict(a=dict(value=255))) == b"\xff"
 
+def test_rawcopy_issue_888():
+    # If you use build_file() on a RawCopy that has only a value defined, then
+    # RawCopy._build may also attempt to read from the file, which won't work
+    # if build_file opened the file for writing only.
+    with tempfile.TemporaryDirectory() as tmpdir:
+        fname = os.path.join(tmpdir, 'test')
+        d = RawCopy(Byte)
+        d.build_file(dict(value=0), filename=fname)
+
 def test_byteswapped():
     d = ByteSwapped(Bytes(5))
     common(d, b"12345", b"54321", 5)

build_file() crashes when using RawCopy with a value only
Thank you for construct!

Here's a failing test case:

    def test_rawcopy_build_file_from_value_only(tmpdir):
        d = RawCopy(Byte)
        d.build_file(dict(value=0), filename=tmpdir.join('test'))

Version: master branch, commit 2626b39.

Expected result: success

Actual result:

    construct.core.StreamError: Error in path (building)
    stream.read() failed, requested 1 bytes

The cause is that `Construct.build_file()` opens the stream for writing only, but `RawCopy._build()` assumes that the stream is readable when it rewinds the stream to read out what was written to populate the `data` attribute.

Pull request to follow.
tests/test_core.py::test_rawcopy_issue_888
tests/test_core.py::test_bytes tests/test_core.py::test_greedybytes tests/test_core.py::test_bytes_issue_827 tests/test_core.py::test_bitwise tests/test_core.py::test_bytewise tests/test_core.py::test_ints tests/test_core.py::test_ints24 tests/test_core.py::test_halffloats tests/test_core.py::test_floats tests/test_core.py::test_formatfield tests/test_core.py::test_formatfield_ints_randomized tests/test_core.py::test_formatfield_floats_randomized tests/test_core.py::test_bytesinteger tests/test_core.py::test_bitsinteger tests/test_core.py::test_varint tests/test_core.py::test_varint_issue_705 tests/test_core.py::test_paddedstring tests/test_core.py::test_pascalstring tests/test_core.py::test_cstring tests/test_core.py::test_greedystring tests/test_core.py::test_string_encodings tests/test_core.py::test_flag tests/test_core.py::test_enum tests/test_core.py::test_enum_enum34 tests/test_core.py::test_enum_enum36 tests/test_core.py::test_enum_issue_298 tests/test_core.py::test_enum_issue_677 tests/test_core.py::test_flagsenum tests/test_core.py::test_flagsenum_enum34 tests/test_core.py::test_flagsenum_enum36 tests/test_core.py::test_mapping tests/test_core.py::test_struct tests/test_core.py::test_struct_nested tests/test_core.py::test_struct_kwctor tests/test_core.py::test_struct_proper_context tests/test_core.py::test_struct_sizeof_context_nesting tests/test_core.py::test_sequence tests/test_core.py::test_sequence_nested tests/test_core.py::test_array tests/test_core.py::test_array_nontellable tests/test_core.py::test_greedyrange tests/test_core.py::test_repeatuntil tests/test_core.py::test_const tests/test_core.py::test_computed tests/test_core.py::test_index tests/test_core.py::test_rebuild tests/test_core.py::test_rebuild_issue_664 tests/test_core.py::test_default tests/test_core.py::test_check tests/test_core.py::test_error tests/test_core.py::test_focusedseq tests/test_core.py::test_pickled tests/test_core.py::test_namedtuple tests/test_core.py::test_hex tests/test_core.py::test_hexdump tests/test_core.py::test_hexdump_regression_issue_188 tests/test_core.py::test_union tests/test_core.py::test_union_kwctor tests/test_core.py::test_union_issue_348 tests/test_core.py::test_select tests/test_core.py::test_select_kwctor tests/test_core.py::test_optional tests/test_core.py::test_optional_in_struct_issue_747 tests/test_core.py::test_optional_in_bit_struct_issue_747 tests/test_core.py::test_select_buildfromnone_issue_747 tests/test_core.py::test_if tests/test_core.py::test_ifthenelse tests/test_core.py::test_switch tests/test_core.py::test_switch_issue_357 tests/test_core.py::test_stopif tests/test_core.py::test_padding tests/test_core.py::test_padded tests/test_core.py::test_aligned tests/test_core.py::test_alignedstruct tests/test_core.py::test_bitstruct tests/test_core.py::test_pointer tests/test_core.py::test_peek tests/test_core.py::test_seek tests/test_core.py::test_tell tests/test_core.py::test_pass tests/test_core.py::test_terminated tests/test_core.py::test_rawcopy tests/test_core.py::test_rawcopy_issue_289 tests/test_core.py::test_rawcopy_issue_358 tests/test_core.py::test_byteswapped tests/test_core.py::test_byteswapped_from_issue_70 tests/test_core.py::test_bitsswapped tests/test_core.py::test_prefixed tests/test_core.py::test_prefixedarray tests/test_core.py::test_fixedsized tests/test_core.py::test_nullterminated tests/test_core.py::test_nullstripped tests/test_core.py::test_restreamdata tests/test_core.py::test_transformed tests/test_core.py::test_transformed_issue_676 tests/test_core.py::test_restreamed tests/test_core.py::test_restreamed_partial_read tests/test_core.py::test_processxor tests/test_core.py::test_processrotateleft tests/test_core.py::test_checksum tests/test_core.py::test_checksum_nonbytes_issue_323 tests/test_core.py::test_checksum_warnings_issue_841 tests/test_core.py::test_compressed_zlib tests/test_core.py::test_compressed_gzip tests/test_core.py::test_compressed_bzip2 tests/test_core.py::test_compressed_lzma tests/test_core.py::test_compressed_prefixed tests/test_core.py::test_rebuffered tests/test_core.py::test_lazy tests/test_core.py::test_lazystruct tests/test_core.py::test_lazyarray tests/test_core.py::test_lazybound tests/test_core.py::test_expradapter tests/test_core.py::test_exprsymmetricadapter tests/test_core.py::test_exprvalidator tests/test_core.py::test_ipaddress_adapter_issue_95 tests/test_core.py::test_oneof tests/test_core.py::test_noneof tests/test_core.py::test_filter tests/test_core.py::test_slicing tests/test_core.py::test_indexing tests/test_core.py::test_probe tests/test_core.py::test_debugger tests/test_core.py::test_repr tests/test_core.py::test_operators tests/test_core.py::test_operators_issue_87 tests/test_core.py::test_from_issue_76 tests/test_core.py::test_from_issue_60 tests/test_core.py::test_from_issue_171 tests/test_core.py::test_from_issue_175 tests/test_core.py::test_from_issue_71 tests/test_core.py::test_from_issue_231 tests/test_core.py::test_from_issue_246 tests/test_core.py::test_from_issue_244 tests/test_core.py::test_from_issue_269 tests/test_core.py::test_hanging_issue_280 tests/test_core.py::test_from_issue_324 tests/test_core.py::test_from_issue_357 tests/test_core.py::test_context_is_container tests/test_core.py::test_from_issue_362 tests/test_core.py::test_this_expresion_compare_container tests/test_core.py::test_exposing_members_attributes tests/test_core.py::test_exposing_members_context tests/test_core.py::test_isparsingbuilding tests/test_core.py::test_struct_stream tests/test_core.py::test_struct_root_topmost tests/test_core.py::test_parsedhook_repeatersdiscard tests/test_core.py::test_greedyrange_issue_697 tests/test_core.py::test_greedybytes_issue_697 tests/test_core.py::test_hex_issue_709 tests/test_core.py::test_buildfile_issue_737