File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " ab_versions"
3- version = " 0.10.0 "
3+ version = " 0.10.1 "
44authors = [" Carl J. Geib" ]
55edition = " 2024"
66
Original file line number Diff line number Diff line change @@ -14,11 +14,16 @@ use std::{
1414 fmt:: Display ,
1515 fs:: File ,
1616 io:: { Read , Write } ,
17- os:: unix:: fs:: FileExt ,
1817 path:: Path ,
1918} ;
2019use thiserror:: Error ;
2120
21+ #[ cfg( unix) ]
22+ use std:: os:: unix:: fs:: FileExt ;
23+
24+ #[ cfg( windows) ]
25+ use std:: os:: windows:: fs:: FileExt ;
26+
2227#[ derive( Error , Debug ) ]
2328pub enum FTypeError {
2429 #[ error( "No version information was found in the file" ) ]
@@ -425,7 +430,12 @@ pub fn fix_crc<P: AsRef<Path>>(path: P) -> Result<(), FtvFileError> {
425430 hasher. update ( & buffer[ ..buffer. len ( ) - 4 ] ) ;
426431 let checksum = hasher. finalize ( ) ;
427432
433+ #[ cfg( unix) ]
428434 file. write_at ( & checksum. to_le_bytes ( ) , buffer. len ( ) as u64 - 4 ) ?;
435+
436+ #[ cfg( windows) ]
437+ file. seek_write ( & checksum. to_le_bytes ( ) , buffer. len ( ) as u64 - 4 ) ?;
438+
429439 file. flush ( ) ?;
430440 Ok ( ( ) )
431441}
@@ -454,10 +464,10 @@ pub fn file_type<P: AsRef<Path>>(path: P) -> MeFiletype {
454464#[ cfg( test) ]
455465mod tests {
456466 use nom:: {
467+ IResult ,
457468 bytes:: complete:: { tag, take_until} ,
458469 character:: complete:: digit1,
459470 combinator:: map_res,
460- IResult ,
461471 } ;
462472
463473 use crate :: strip_protection;
You can’t perform that action at this time.
0 commit comments