[Lldb-commits] [clang] [clang-tools-extra] [lldb] [llvm] [SystemZ][z/OS] Propagate IsText parameter to open text files as text (PR #107906)

Abhina Sree via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 20 05:56:10 PDT 2024


================
@@ -323,10 +325,11 @@ ErrorOr<Status> RealFileSystem::status(const Twine &Path) {
 }
 
 ErrorOr<std::unique_ptr<File>>
-RealFileSystem::openFileForRead(const Twine &Name) {
+RealFileSystem::openFileForRead(const Twine &Name, bool IsText) {
   SmallString<256> RealName, Storage;
   Expected<file_t> FDOrErr = sys::fs::openNativeFileForRead(
-      adjustPath(Name, Storage), sys::fs::OF_None, &RealName);
+      adjustPath(Name, Storage), IsText ? sys::fs::OF_Text : sys::fs::OF_None,
----------------
abhina-sree wrote:

I will look into this and see if I hit any issues. I think if the file already exists, we can deduce it here, but in the case the file does not exist, we do not know whether the file is supposed to be text or binary without additional context

https://github.com/llvm/llvm-project/pull/107906


More information about the lldb-commits mailing list