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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -