[Lldb-commits] [PATCH] D18228: Make File option flags consistent for Python API

Greg Clayton via lldb-commits lldb-commits at lists.llvm.org
Thu Mar 17 10:02:24 PDT 2016


clayborg requested changes to this revision.
This revision now requires changes to proceed.

================
Comment at: source/Host/common/File.cpp:48
@@ -47,3 +47,3 @@
         }
-        else if (options & File::eOpenOptionWrite)
+        else
         {
----------------
This change isn't needed if "File::eOpenOptionWrite" is specified in the "a+" spec below...

================
Comment at: source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp:1258
@@ -1257,3 +1257,3 @@
     .Case("w+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate|File::eOpenOptionTruncate)
-    .Case("a+",  File::eOpenOptionRead|File::eOpenOptionWrite|File::eOpenOptionCanCreate)
+    .Case("a+",  File::eOpenOptionAppend|File::eOpenOptionRead|File::eOpenOptionCanCreate)
     .Default(0);
----------------
Docs for this say:
```
     ``a+''  Open for reading and writing.  The file is created if it does not exist.  The stream is posi-tioned positioned
             tioned at the end of the file.  Subsequent writes to the file will always end up at the then
             current end of file, irrespective of any intervening fseek(3) or similar.
```

Why is the File:: eOpenOptionWrite not included for "a+"?


http://reviews.llvm.org/D18228





More information about the lldb-commits mailing list