Closed toothbrush7777777 closed 5 years ago
Thanks a lot! Looks good to me overall.
One small nit: Could you rename the first padding
binding to something else, e.g. remainder
? Then we wouldn't have two bindings with the same name but different semantics.
@phil-opp Done. I also formatted the changes as suggested by cargo fmt -- --check
.
Thanks!
bors r+
@phil-opp Whoops, looks like I shouldn't have formatted the code further.
bors r+
bors r-
I think we can merge this manually (pending the CI checks).
Seems like the test failed on Windows:
Error: I/O error: failed to pad boot image to a multiple of the block size: Access is denied. (os error 5)
@phil-opp Any idea what the problem could be?
Finally passes all checks!
I found a comment which seems related:
.append(true)
doesn't set all the bits ofGENERIC_WRITE
, it misses theFILE_WRITE_DATA
bit as @retep998 mentioned. […]— https://github.com/rust-lang/rust/issues/54118#issuecomment-420299904
I guess that whatever API is used internally by Rust for File::set_len
on Windows requires that flag. I've changed the code to use write(true)
instead of append(true)
and all the checks have now successfully passed.
Thanks for investigating! Let's get this merged!
Thanks a lot for tackling this! I will publish a new version tomorrow when I'm at my computer again.
@phil-opp Cool, that will be great.
Released as version 0.7.4.
Closes #35.