Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "rda_python_common"
version = "1.0.43"
version = "1.0.44"
authors = [
{ name="Zaihua Ji", email="[email protected]" },
]
Expand Down
7 changes: 5 additions & 2 deletions src/rda_python_common/PgFile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,10 @@ def local_file_stat(file, fstat, opt, logact):

info = {}
info['isfile'] = (1 if stat.S_ISREG(fstat.st_mode) else 0)
info['data_size'] = fstat.st_size if info['isfile'] else local_path_size(file)
if info['isfile'] == 0 and logact&PgLOG.PFSIZE:
info['data_size'] = local_path_size(file)
else:
info['data_size'] = fstat.st_size
info['fname'] = op.basename(file)
if not opt: return info
if opt&64 and info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']:
Expand Down Expand Up @@ -2573,7 +2576,7 @@ def local_file_size(file, opt = 0, logact = 0):
if opt&4: lmsg(file, PgLOG.PGLOG['MISSFILE'], logact)
return -1 # file not eixsts

info = check_local_file(file, 0, logact)
info = check_local_file(file, 0, logact|PgLOG.PFSIZE)
if info:
if info['isfile'] and info['data_size'] < PgLOG.PGLOG['MINSIZE']:
if opt:
Expand Down
1 change: 1 addition & 0 deletions src/rda_python_common/PgLOG.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
SKPTRC = (0x400000) # action to skip tracing when log errors
UCNAME = (0x800000) # action to change query field names to upper case
UCLWEX = (0x800015) # UCNAME|MSGLOG|WARNLG|EXITLG
PFSIZE = (0x1000000) # total file size under a path

SUCCESS = 1 # Successful function call
FINISH = 2 # go through a function, including time out
Expand Down