I'm at the early stages of developing a fs for handling transcoding of
unsupported files on to portable media players (and plain copying of
supported files). Still wrapping my head around the way FUSE operates... :)
Currently files are written to a holding area in the home dir as they
are copied over. The plan is to initiate transfer of a file to the
device on the release callback.
Copying a file to the holding area (with cp or a file manager such as
mc) results in roughly these callbacks:
write() x (filesize/4096)
flush() x 1
Am I to understand that the file path is never closed? Is closing
handles on a file path something I should be taking care of? (There are
handles open on real files associated with the virtual locations which I
had hoped to close in the release() callback).
Also, would it be possible to exploit the flush() callback to start the
transferring of files? I believe release is asynchronous and I'd
ideally like any copy to block until the file is on the device.
Perl Bindings 0.09_3
> Copying a file to the holding area (with cp or a file manager such as
> mc) results in roughly these callbacks:
> write() x (filesize/4096)
> flush() x 1
I hadn't added the release callback to the call to Fuse::main... but I'm
sure you all guessed that ;-)
/me crawls under a rock.
*mumble* embarrassing *mumble*
Still wondering if anyone has a method to exploit the flush callback.