You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in #41, I am trying to use this project via FUSE. The current work in progress works quite fine already.
Bash script to test the work-in-progress state.
# Would be nice to have this without sudo, but I don't want to create test cases with the same program being tested.
head -c $((1024*1024)) /dev/zero >'folder-symlink.fat'
mkfs.fat 'folder-symlink.fat'
mkdir mounted
sudo mount 'folder-symlink.fat' mounted
cd mounted
sudo mkdir -p foo/fighter
echo bar | sudo tee > foo/fighter/ufo
sudo umount mounted
python3 -m pip install --user --force-reinstall \
'git+https://github.com/mxmlnkn/ratarmount.git@fat#egginfo=ratarmountcore&subdirectory=core' \
'git+https://github.com/mxmlnkn/ratarmount.git@fat#egginfo=ratarmount'
ratarmount folder-symlink.fat mounted
tree mounted
# mounted/# └── foo# └── fighter# └── ufo## 2 directories, 1 file
However, for integration, I need a isFATImage function that can relatively quickly check a given bytes file object whether it is a FAT file / image. Normally, these check functions would only require checking the first 2-10 bytes, depending on the file format, but for FAT it is probably not all that easy. Currently, I call private functions of pyfatfs to achieve something like this:
fs=PyFat.PyFat()
fs._PyFat__set_fp(fileObject)
fs.is_read_only=Truetry:
fs.parse_header()
returnTrueexceptpyfatfs.PyFATException:
returnFalsefinally:
# Reset file object so that it does not get closed! Cannot be None because that is checked.fs._PyFat__fp=io.BytesIO()
It would be nice to have some officially supported way to do something like this. I am not sure whether _parse_fat, in addition to parse_header, should be included in such a check. It depends a bit on how much it checks.
The text was updated successfully, but these errors were encountered:
As mentioned in #41, I am trying to use this project via FUSE. The current work in progress works quite fine already.
Bash script to test the work-in-progress state.
However, for integration, I need a
isFATImage
function that can relatively quickly check a given bytes file object whether it is a FAT file / image. Normally, these check functions would only require checking the first 2-10 bytes, depending on the file format, but for FAT it is probably not all that easy. Currently, I call private functions of pyfatfs to achieve something like this:It would be nice to have some officially supported way to do something like this. I am not sure whether
_parse_fat
, in addition toparse_header
, should be included in such a check. It depends a bit on how much it checks.The text was updated successfully, but these errors were encountered: