c++ - ifstream a file which another program is writing to? -
what happens when try open file using std::ifstream
while file being written application?
that depends on sharing mode used open file in other program. if open mode use compatible sharing mode, you'll open file. otherwise, open fail. c++ doesn't offer "sharing modes," though, sharing modes whatever vendor's implementation happens use. if really want control on how open file, use os-provided functions (createfile
, in case).
as writes other program take effect, you'll able read them in program. if write file, writes , other program's writes might interfere each other, causing data loss or jumbled output; don't that.
Comments
Post a Comment