From: Peter <sw...@ho...> - 2005-11-20 16:40:09
|
There was a thread on rox-users about browsing zip files with avfs, and after some discussion, Jonatan Liljedahl helped resolve the issue with explaining how avfs works with fuse. AVFS is functionally useless with kernel 2.6 or glibc >= 2.1. Therefore I wanted to offer a suggestion for better integration of AVFS with rox for consideration. Not being familiar with the development of rox, I figured I would lay out a framework. 1) Initalize a global, gchar *AVFS_path and set it to "" (not null), this will be used later in the menu.c file, function open_vfs_avfs. 2) During rox init sequence, create a routine which tests for avfs. a) stat /#avfsstat. If afvs is installed with coda or preloaded, stat will not fail. If so, nothing needs to be done with AVFS_path, since the current functionality of adding a # to a filename will work. b) stat ~/.avfs. The init routine for avfs using fuse has this directory as a default. Problem is that if the user modifies the ~/.avfs location, then this will fail. On Success, set *AVFS_path = ~/.avfs - OR - c) grep mtab or /proc/mounts and search for ^avfsd. If there, extract the second word of the line which will be the location of the avfs mount point. Set *AVFS_PATH to this. On my system that is: avfsd /home/peter/.avfs fuse rw,nosuid..... 3) Either way, when the function open_vfs_avfs gets called, the line path = g_strconcat(filer_window->sym_path, "/", item->leafname, "#", NULL); could be modified to include the *AVFS_path global. Something like this: path = g_strconcat(*AVFS_path, filer_window->sym_path, "/", item->leafname, "#", NULL); I realize this is a hack, and Jonatan's suggestion of creating a run action for avfs works fine. The downside of his approach is that you LOSE functionality by losing the run action for the original filetype, whereas here, you ADD functionality by allowing AVFS to function in two different scenarios -- with or without fuse. In addition, should AVFS NOT be installed, the proper thing to do would be to turn off the menu choice "Open AVFS Ctrl+O" so the user cannot use the command. Perhaps this would require a boolean such as AVFS_Installed. If the above tests fail, set it to FALSE, otherwise TRUE. JM $0.02. |