The Arduino SD library is an Arduino wrapper of old version of SdFat library (put into utility subfolder of the SD library). This SdFat library has constants like O_READ, O_WRITE, O_APPEND.
Arduino wrapper has constants
#define FILE_READ O_READ
#define FILE_WRITE (O_READ | O_WRITE | O_CREAT | O_APPEND)
You can use the SdFa library constants in the wrapper calls.
File dataFile = SD.open("datalog.txt", O_READ | O_WRITE | O_CREAT);
Warning: not all versions of SD library bundled in different board packages have O_APPEND in #define FILE_WRITE
. Even in the Arduino SD library the O_APPEND was removed some time ago and then the change was reverted, because all dataloger examples used FILE_WRITE.