* [Patch] BaseTools: Fix the bug to handle the read-only RAW file
@ 2016-09-14 3:37 Yonghong Zhu
0 siblings, 0 replies; only message in thread
From: Yonghong Zhu @ 2016-09-14 3:37 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao
current we use 'r+b' to open the RAW file, it report failure for the
read-only files. so this patch change it to use 'rb' to open the file
since we only read it and no need to write.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
BaseTools/Source/Python/GenFds/FfsFileStatement.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
index 690826b..f76ddf4 100644
--- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
@@ -99,11 +99,11 @@ class FileStatement (FileStatementClassObject) :
FileContent = ''
MaxAlignIndex = 0
MaxAlignValue = 1
for Index, File in enumerate(self.FileName):
try:
- f = open(File, 'r+b')
+ f = open(File, 'rb')
except:
GenFdsGlobalVariable.ErrorLogger("Error opening RAW file %s." % (File))
Content = f.read()
f.close()
AlignValue = 1
--
2.6.1.windows.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2016-09-14 3:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-14 3:37 [Patch] BaseTools: Fix the bug to handle the read-only RAW file Yonghong Zhu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox