Skip to content

Commit

Permalink
Update pyarchivefile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KazukiPrzyborowski committed Jan 31, 2025
1 parent e5bca1f commit 1f90fa7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pyarchivefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3403,6 +3403,8 @@ def AppendFilesWithContent(infiles, fp, dirlistfromtxt=False, filevalues=[], ext
fname = curfname
else:
fname = "./"+curfname
if(not os.path.exists(fname)):
return False
if(verbose):
VerbosePrintOut(fname)
if(not followlink or followlink is None):
Expand Down Expand Up @@ -3473,6 +3475,8 @@ def AppendFilesWithContent(infiles, fp, dirlistfromtxt=False, filevalues=[], ext
curfid = curfid + 1
if(ftype == 2):
flinkname = os.readlink(fname)
if(not os.path.exists(flinkname)):
return False
try:
fdev = fstatinfo.st_rdev
except AttributeError:
Expand Down Expand Up @@ -3583,6 +3587,8 @@ def AppendFilesWithContent(infiles, fp, dirlistfromtxt=False, filevalues=[], ext
fcontents.close()
fcontents = cfcontents
if(followlink and (ftype == 1 or ftype == 2)):
if(not os.path.exists(flinkname)):
return False
flstatinfo = os.stat(flinkname)
with open(flinkname, "rb") as fpc:
shutil.copyfileobj(fpc, fcontents)
Expand Down Expand Up @@ -3670,6 +3676,8 @@ def AppendListsWithContent(inlist, fp, dirlistfromtxt=False, filevalues=[], extr
fname = curfname[3]
else:
fname = "./"+curfname[3]
if(not os.path.exists(fname)):
return False
fbasedir = os.path.dirname(fname)
flinkname = curfname[4]
fsize = format(curfname[5], 'x').lower()
Expand Down Expand Up @@ -4843,6 +4851,8 @@ def PackArchiveFile(infiles, outfile, dirlistfromtxt=False, fmttype="auto", comp
fname = curfname
else:
fname = "./"+curfname
if(not os.path.exists(fname)):
return False
if(verbose):
VerbosePrintOut(fname)
if(not followlink or followlink is None):
Expand Down Expand Up @@ -4913,6 +4923,8 @@ def PackArchiveFile(infiles, outfile, dirlistfromtxt=False, fmttype="auto", comp
curfid = curfid + 1
if(ftype == 2):
flinkname = os.readlink(fname)
if(not os.path.exists(flinkname)):
return False
try:
fdev = fstatinfo.st_rdev
except AttributeError:
Expand Down Expand Up @@ -5024,6 +5036,8 @@ def PackArchiveFile(infiles, outfile, dirlistfromtxt=False, fmttype="auto", comp
if(fcompression == "none"):
fcompression = ""
if(followlink and (ftype == 1 or ftype == 2)):
if(not os.path.exists(flinkname)):
return False
flstatinfo = os.stat(flinkname)
with open(flinkname, "rb") as fpc:
shutil.copyfileobj(fpc, fcontents)
Expand Down Expand Up @@ -7840,6 +7854,8 @@ def ListDirToArrayAlt(infiles, dirlistfromtxt=False, fmttype=__file_format_defau
fname = curfname
else:
fname = "./"+curfname
if(not os.path.exists(fname)):
return False
if(verbose):
VerbosePrintOut(fname)
if(not followlink or followlink is None):
Expand Down Expand Up @@ -7911,6 +7927,8 @@ def ListDirToArrayAlt(infiles, dirlistfromtxt=False, fmttype=__file_format_defau
curfid = curfid + 1
if(ftype == 2):
flinkname = os.readlink(fname)
if(not os.path.exists(flinkname)):
return False
try:
fdev = fstatinfo.st_rdev
except AttributeError:
Expand Down Expand Up @@ -7974,6 +7992,8 @@ def ListDirToArrayAlt(infiles, dirlistfromtxt=False, fmttype=__file_format_defau
fcsize = fcontents.tell()
fcencoding = GetFileEncoding(fcontents, False)
if(followlink and (ftype == 1 or ftype == 2)):
if(not os.path.exists(flinkname)):
return False
flstatinfo = os.stat(flinkname)
with open(flinkname, "rb") as fpc:
shutil.copyfileobj(fpc, fcontents)
Expand Down

0 comments on commit 1f90fa7

Please sign in to comment.