1 /* Copyright 1996,1997,2001,2002,2007,2009 Alain Knaff.
2 * This file is part of mtools.
4 * Mtools is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * Mtools is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with Mtools. If not, see <http://www.gnu.org/licenses/>.
18 * Managing a cache of open disks
21 #include "sysincludes.h"
30 static int is_initialized = 0;
31 static Stream_t *fss[256]; /* open drives */
33 static void finish_sc(void)
38 if(fss[i] && fss[i]->refs != 1 )
39 fprintf(stderr,"Streamcache allocation problem:%c %d\n",
45 static void init_streamcache(void)
57 Stream_t *open_root_dir(unsigned char drive, int flags, int *isRop)
63 drive = toupper(drive);
69 Fs = fs_init(drive, flags, isRop);
71 fprintf(stderr, "Cannot initialize '%c:'\n", drive);