mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-24 17:27:21 +00:00
fatfsgen.py: omit cluster allocation when the file is empty
This commit is contained in:
@@ -69,8 +69,10 @@ def traverse_folder_tree(directory_bytes_: bytes,
|
||||
entry_position_=i,
|
||||
lfn_checksum_=lfn_checksum(obj_['DIR_Name'] + obj_['DIR_Name_ext']))
|
||||
if obj_['DIR_Attr'] == Entry.ATTR_ARCHIVE:
|
||||
content_ = fat_.get_chained_content(cluster_id_=Entry.get_cluster_id(obj_),
|
||||
size=obj_['DIR_FileSize'])
|
||||
content_ = b''
|
||||
if obj_['DIR_FileSize'] > 0:
|
||||
content_ = fat_.get_chained_content(cluster_id_=Entry.get_cluster_id(obj_),
|
||||
size=obj_['DIR_FileSize'])
|
||||
with open(os.path.join(name, obj_name_), 'wb') as new_file:
|
||||
new_file.write(content_)
|
||||
elif obj_['DIR_Attr'] == Entry.ATTR_DIRECTORY:
|
||||
|
Reference in New Issue
Block a user