protected File getFile(JPackage pkg, String fileName ) throws IOException {
        File dir;
        if(pkg.isUnnamed())
            dir = target;
        else
            dir = new File(target, toDirName(pkg));
        
        if(!dir.exists())   dir.mkdirs();
        
        File fn = new File(dir,fileName);
        
        if (fn.exists()) {
            if (!fn.delete())
                throw new IOException(fn + ": Can't delete previous version");
        }
        
        
        if(readOnly)        readonlyFiles.add(fn);
        return fn;
    }