Skip to content

Instantly share code, notes, and snippets.

@ricarkol
Created April 21, 2018 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ricarkol/f72687245e143bc04ba4814c6088d13e to your computer and use it in GitHub Desktop.
Save ricarkol/f72687245e143bc04ba4814c6088d13e to your computer and use it in GitHub Desktop.
Test for the ocaml-fat bin
umount /tmp/mnt_fat_test || true
mkdir -p /tmp/mnt_fat_test
(
dd if=/dev/zero of=test/disk-512.dat count=4096 bs=4096
mkfs.fat -f 1 -S 512 test/disk-512.dat
mount test/disk-512.dat /tmp/mnt_fat_test
cd /tmp/mnt_fat_test
bash -c "mkdir -p {root1,root2}/{abc,xyz/cba/zyx}"
echo bla > bla
echo root1_bla > root1/bla
echo root1_abc_bla > root1/abc/bla
echo root1_xyz_bla > root1/xyz/bla
echo root1_xyz_cba_bla > root1/xyz/cba/bla
echo root1_xyz_cba_zyx_bla > root1/xyz/cba/zyx/bla
echo root2_bla > root2/bla
echo root2_abc_bla > root2/abc/bla
echo root2_xyz_bla > root2/xyz/bla
echo root2_xyz_cba_bla > root2/xyz/cba/bla
echo root2_xyz_cba_zyx_bla > root2/xyz/cba/zyx/bla
)
sync
umount /tmp/mnt_fat_test
echo both should print 41
fsck.fat -vl test/disk-512.dat | grep "Checking file" | wc -l
./_build/install/default/bin/fat list --unbuffered test/disk-512.dat | grep -a bytes | wc -l
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment