Hi,I would like to implement my own file system, as described in fuse.h, i.e., like so:struct fuse_operations g_my_fuse_operations = { ... };...nacl_io_register_mount_type("myfusefs", &g_my_fuse_operations);...mount("", "/mnt/fuse", "myfusefs", 0, NULL);The idea is to allow my PNaCl module to access Javascript File and Blob objects, which are passed to the module as a URL created by URL.createObjectURL(file).When I follow above's instructions from fuse.h, I cannot seem to get access to the "source" and "data" parameters of the mount(...) call. In fact, I probably had to create a C++ wrapper like to the built-in file systems (html5fs and friends). As this is somewhat of an overhead for what I would like to accomplish (let my PNaCl module use POSIX file I/O calls to read from a single Javascript file), I would like to have my code as compact as possible (reuse is less of an issue). However, I need to find a way how to pass the URL of the file to the fuse operations. Is there any advised method of doing so (apart from creating the aforementioned C++ wrapper)?
Btw, a generic, built-in file system for JS File and Blob objects would be fantastic. Ideally, I could specify an entire directory tree within the "data" argument of the mount(...) call, where I can map file names to FIle/Blob URLs. Alternatively, the existing httpfs could be extended, to be able to deal with other URL schemes, namely blob: and data: URLs. Not sure if it is already supposed to do that - I tried to use it this way, but it would not work.
Soeren
Ultimately, I think Chrome (and other browsers for that matter) should IMHO support HEAD requests for blob and data URLs, making it more compatible to http URLs.
--
You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/mOD46_QDjoc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.
Actually, partial requests do work for blob URLs. You can even watch them in the network tab of the debugging tools. The file comes straight from the users's local file system, i.e. from a file input form element.I have the patch I proposed running and it works. Will push it for review in the coming days.
I think the entire file will have to be fetched anyway, because IIRC blob URLs don't support partial requests. Where are these very large files coming from? Do they live on the user's machine or on the server? Are they static?--
On Saturday, April 5, 2014 2:10:55 AM UTC-7, Soeren Balko wrote:Not sure that I would go for an approach where we need to fetch the entire file to figure out its length. In my case, I need to process very large files, easily some GBs in size. Besides querying the file size in JS and passing it as a mount parameter, one could employ a binary search approach where we try to seek to the end of the file, fetching a one-byte partial content answer.Ultimately, I think Chrome (and other browsers for that matter) should IMHO support HEAD requests for blob and data URLs, making it more compatible to http URLs.
You received this message because you are subscribed to a topic in the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/native-client-discuss/mOD46_QDjoc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to native-client-discuss+unsub...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-client-discuss@googlegroups.com.