• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env python3
2# Copyright 2017 The Chromium Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6# Script that prints out number of files in given zip-archive. Used for testing.
7
8import os
9import sys
10import zipfile
11
12if sys.version_info.major == 2:
13    from ConfigParser import ConfigParser
14else:
15    from configparser import ConfigParser
16
17seed_corpus_archive_path = os.path.join(os.path.dirname(sys.argv[0]),
18                                                        sys.argv[1])
19
20if not os.path.exists(seed_corpus_archive_path):
21  sys.exit(-1)
22
23archive = zipfile.ZipFile(seed_corpus_archive_path)
24sys.stdout.write('%d\n' % len(archive.namelist()))
25