mirror of https://github.com/ecmwf/eccodes.git
ECC-917: Create 4 output files
This commit is contained in:
parent
87388625e7
commit
e917b37cad
9
memfs.py
9
memfs.py
|
@ -30,6 +30,7 @@ print('Excluding: ', EXCLUDED)
|
|||
FILES = {}
|
||||
SIZES = {}
|
||||
NAMES = []
|
||||
CHUNK = 5500 * 1000 # chunk size in bytes
|
||||
|
||||
# Binary to ASCII function. Different in Python 2 and 3
|
||||
try:
|
||||
|
@ -41,10 +42,10 @@ except:
|
|||
|
||||
# The last argument is the base name of the generated C file(s)
|
||||
output_file_path = sys.argv[-1]
|
||||
CHUNK = 7 * 1000 * 1000 # chunk size in bytes
|
||||
totsize = 0 # amount written
|
||||
fcount = 0
|
||||
opath = output_file_path + "_" + str(fcount).zfill(3) + ".c"
|
||||
print('Generating output: ', opath)
|
||||
g = open(opath, "w")
|
||||
|
||||
for directory in dirs:
|
||||
|
@ -102,14 +103,14 @@ for directory in dirs:
|
|||
g.close()
|
||||
fcount += 1
|
||||
opath = output_file_path + "_" + str(fcount).zfill(3) + ".c"
|
||||
#print('Generating output: ', opath)
|
||||
print('Generating output: ', opath)
|
||||
g = open(opath, "w")
|
||||
totsize = 0
|
||||
|
||||
g.close()
|
||||
assert fcount == 2
|
||||
assert fcount == 3
|
||||
opath = output_file_path + "_final.c"
|
||||
#print('Generating output: ', opath)
|
||||
print('Generating output: ', opath)
|
||||
g = open(opath, "w")
|
||||
|
||||
print("""
|
||||
|
|
|
@ -9,6 +9,7 @@ set( generated_c_files
|
|||
${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_000.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_001.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_002.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_003.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/memfs_gen_final.c)
|
||||
|
||||
add_custom_command(
|
||||
|
|
Loading…
Reference in New Issue