On Wednesday, 10 January 2018 13:07:49 CET Cédric Bosdonnat wrote:
let rec part_get_gpt_type device partnum = - sgdisk_info_extract_uuid_field device partnum "Partition GUID code" + sgdisk_info_extract_field device partnum "Partition GUID code" + ("-" ^ hex_chars) and part_get_gpt_guid device partnum = - sgdisk_info_extract_uuid_field device partnum "Partition unique GUID" + sgdisk_info_extract_field device partnum "Partition unique GUID" + ("-" ^ hex_chars)
IMHO a better option here would be to pass as parameter, instead of the allowed characters (which is an implementation of the extract_uuid function), the function itself. This would bring this code much like as it was the old C version of it, and even help for patch #2 of this series. The sgdisk_info_extract_uuid_field -> sgdisk_info_extract_field renaming is OK. -- Pino Toscano