Fat_nameval epoch : datetimetype lfn = {lfn_deleted : bool; | |
lfn_last : bool; | (* marks the highest sequence number *) |
lfn_seq : int; | |
lfn_checksum : int; | |
lfn_utf16_name : string; |
}Long filename entry: the same size as an original DOS disk entry
type dos = {filename : string; | (* 8 chars *) |
ext : string; | (* 3 chars *) |
deleted : bool; | |
read_only : bool; | |
system : bool; | |
volume : bool; | |
subdir : bool; | |
archive : bool; | |
create : datetime; | |
access : datetime; | |
modify : datetime; | |
start_cluster : int; | |
file_size : int32; | |
is_dot : bool; | |
is_dotdot : bool; |
}A DOS disk entry
A high-level directory entry, complete with reconstructed UTF name and offsets of each individual entry on the disk
val fake_root_entry : rval file_size_of : r -> int32val deleted : r -> boolval filename_of : r -> stringval to_single_entries : r -> single_entry listval compute_checksum : dos -> intReturns the checksum corresponding to the 8.3 DOS filename
val make : ?read_only:bool -> ?system:bool -> ?subdir:bool -> string -> rval to_string : r -> stringto_string r returns a canonical version of the name in UTF-8
val to_pretty_string : r -> stringto_pretty_string r returns a pretty version of the filename, containing both legacy DOS, extra UTF16, size and time components.
val int_of_time : datetime -> intval time_of_int : int -> int -> int -> datetimeval int_of_date : datetime -> intval unmarshal : Cstruct.t -> single_entryunmarshal slot parses a single directory entry from slot
val marshal : Cstruct.t -> single_entry -> unitmarshal slot single_entry writes single_entry into slot
blocks bits returns the directory chopped into individual bitstrings, each one containing a possible name (fragment)
val fold : ( 'a -> int -> r -> 'a ) -> 'a -> Cstruct.t -> 'afold f initial bits folds f acc offset dir_entry across all the reconstructed directory entries contained in bits.
val list : Cstruct.t -> r listlist bits returns a list of valid (not deleted) directory entries contained within the directory bits
next bits returns the bit offset of a free directory slot. Note this function does not recycle deleted elements.
val add : Cstruct.t -> r -> Fat_update.t listadd block t return the update required to add t to the directory block. Note the update may be beyond the end of block indicating more space needs to be allocated.
val name_match : string -> r -> boolfind name list returns Some d where d is a name with name name (or None)
val remove : Cstruct.t -> string -> Fat_update.t listremove buf filename erases any entries corresponding to filename from buf
val modify : Cstruct.t -> string -> int32 -> int -> Fat_update.t listmodify buf filename file_size start_cluster changes any entry corresponding to filename in buf to have file_size and start_cluster