<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" id="owaParaStyle"></style>
</head>
<body fpstyle="1" ocsi="0">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">I have a semi-functional (getting ntfs device name eludes me) implementation of blkid that I would be willing to toybox if there is any interest (Its not on the list AFAICT, so
 I will be brief)
<div><br>
</div>
<div>The implementation is as follows:</div>
<div>1.  read 65k buffer from file (reiserfs and others have superblock starting at 64k)</div>
<div>2.  perform switch cases @ 0 offset to compare to many magics (0 is a fairly common offset)</div>
<div><span style="font-size: 10pt;">**Note: the switch case really provides no benefit over if-else in this situation since the Magic values are too far apart to be optimized into a jump table.  I can change this for uniformity if desired.</span></div>
<div><span style="font-size: 10pt;">3. Then go through the rest of the fs types and check for #defined magic @ #defined offset(s)</span></div>
<div><span style="font-size: 10pt;">4. If a match is found it returns the result of print_fsinfo(char *fstype, int UUID_offset, int UUID_type, int name_offset, int name_len) where the </span><span style="font-size: 10pt;">UUID_offset, UUID_type, name_offset,
 name_len are also #defined in the header for that fs type.</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">I know many people only want to get the fs type (for mount) instead of the full blkid output.  Does toybox have some kind of facility for setting function pointers based on the name it is called with or a way to get the current
 toy-command name to use for conditional code?</span></div>
<div><span style="font-size: 10pt;"><br>
</span></div>
<div><span style="font-size: 10pt;">R,</span></div>
<div><span style="font-size: 10pt;">Brad Conroy</span></div>
</div>
</body>
</html>