From: Peter <sw...@ho...> - 2005-11-22 16:06:45
|
Here's a small program that accomplishes what I want. It's been about 100 years since I wrote C code, but it illustrates what I want to do. I envision something like this residing in mount.c and return the character string that is found, or a "". It will be called from the open_vfs_avfs function in menu.c and the result prepended to the call to filer_change_to. Something like this??? gchar *avfs_path; avfs_path = getavfs_path(); /* new function in mount.c */ path = g_strconcat(avfs_path, filer_window->sym_path, "/", item->leafname, "#", NULL); filer_change_to(filer_window, path, NULL); This would accomplish setting the true path for virtual access to avfs. Then, in mount.c, add something like this program as a function. /* stupid program to try and guess where avfs is hiding! * will try avfs and try coda */ #include <stdio.h> #include <string.h> #include <mntent.h> main( int argc, char *argv[] ) { struct mntent *info; FILE *mtab_file; /* _PATH_MOUNTED is default mtab file * at least with my libc */ mtab_file = setmntent( _PATH_MOUNTED, "r" ); if ( mtab_file == NULL ) printf("%s\n", "Error, something bad happened!"); /* Loop through MTAB. If neither the * avfsd or coda device is present, then * continue reading mtab. * If either IS found, then just print out * the device and path */ while ( info = getmntent( mtab_file ) ) { if ( strcmp( "avfsd", info->mnt_fsname ) && strcmp( "coda", info->mnt_fsname ) ) continue; printf( "%s\t%s\n", info->mnt_fsname, info->mnt_dir ); } endmntent( mtab_file ); } However, Joanatan's workaround of setting a run action for all compressed files also works fine :) |