-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathisolist.c
57 lines (43 loc) · 1.62 KB
/
isolist.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011
Rocky Bernstein <[email protected]>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Simple program to show using libiso9660 to list files in a directory of
an ISO-9660 image and give some iso9660 information. See the code
to iso-info for a more complete example.
If a single argument is given, it is used as the ISO 9660 image to
use in the listing. Otherwise a compiled-in default ISO 9660 image
name (that comes with the libcdio distribution) will be used.
*/
/* Set up a CD-DA image to test on which is in the libcdio distribution. */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <cdio/cdio.h>
#include <cdio/iso9660.h>
int main(int argc, const char *argv[])
{
char const *psz_fname;
iso9660_t *p_iso;
if (argc > 2)
psz_fname = argv[2];
p_iso = iso9660_open (psz_fname);
if (NULL == p_iso) {
printf("Sorry, couldn't open %s as an ISO-9660 image\n", psz_fname);
return 1;
}
iso9660_close(p_iso);
return 0;
}