4
4
* fuse/umfuse module for iso9660 filesystem support
6
* Copyright 2005,2006 Renzo Davoli University of Bologna - Italy
6
* Copyright 2005,2006,2007 Renzo Davoli University of Bologna - Italy
8
8
* This program is free software; you can redistribute it and/or modify
9
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
10
* the Free Software Foundation; either version 2 of the License
13
12
* This program is distributed in the hope that it will be useful,
14
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
19
18
* with this program; if not, write to the Free Software Foundation, Inc.,
20
19
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
* $Id: fuseiso9660.c,v 1.2 2006/08/21 14:07:33 rd235 Exp $
21
* $Id: fuseiso9660.c,v 1.5 2007/04/23 10:00:16 garden Exp $
387
388
memset (stbuf,0,sizeof(struct stat));
388
389
/* XXX workaround
389
390
* should be unique and != existing devices */
390
stbuf->st_dev=(dev_t) isofs;
391
stbuf->st_dev=(dev_t) ((long)isofs);
391
392
switch (isostat->type) {
393
394
stbuf->st_mode=__S_IFREG|0555;break;
572
573
static int f_iso9660_release(const char *path, struct fuse_file_info *fi)
574
struct iso9660fileinfo *fh9660=(struct iso9660fileinfo *)(fi->fh);
575
struct iso9660fileinfo *fh9660=(struct iso9660fileinfo *)((long)(fi->fh));
575
576
if (fh9660 != NULL) {
576
577
if (fh9660->pointer_block != NULL)
577
578
free(fh9660->pointer_block);
706
707
struct fuse_context *mycontext;
707
708
iso9660_t *isofs;
711
//if (strcmp(argv[1],"-o")==0)
713
//isofs=iso9660_open(argv[1]);
714
isofs=iso9660_open_ext(argv[argc-2],ISO_EXTENSION_ALL);
711
v2f_usage(argv[0],&iso9660_oper);
712
v2f_rearrangeargv(argc,argv);
713
//isofs=iso9660_open_ext(argv[argc-2],ISO_EXTENSION_ALL);
714
isofs=iso9660_open_ext(argv[1],ISO_EXTENSION_ALL);
715
715
//printf("open %s %p\n",argv[argc-2],isofs);
716
716
iso9660_ifs_read_superblock(isofs,ISO_EXTENSION_ALL);
717
717
cdio_loglevel_default=CDIO_LOG_ERROR;
718
718
if (isofs!=NULL) {
719
720
#if ( FUSE_MINOR_VERSION <= 4 )
720
721
fuse_fd = fuse_mount(argv[argc-1], "ro");
722
723
char *argargv[]={"ro",NULL};
723
724
struct fuse_args arg={1,argargv,0};
724
fuse_fd = fuse_mount(argv[argc-1], &arg);
726
fuse_fd = fuse_mount(argv[argc+1], &arg);
726
728
#if ( FUSE_MINOR_VERSION <= 5 )
727
729
fuse = fuse_new(fuse_fd, NULL, &iso9660_oper, sizeof(iso9660_oper));
730
732
fuse = fuse_new(fuse_fd, &arg, &iso9660_oper, sizeof(iso9660_oper),isofs);
732
734
//printf("MOUNT OKAY!\n");
737
#if ( FUSE_MINOR_VERSION <= 5 )
739
fuse_main(--argc,++argv,&iso9660_oper);
741
fuse_main(--argc,++argv,&iso9660_oper,isofs);
736
744
iso9660_close(isofs);