I need to read files from folder that is actually set as subversion repository (or similar name) - files are being managed by subversioning system (TFS, TortoiseSVN...)
This means that the files I need to read, can't be locked as at any time one of the developers might be using it... so, I need to make sure I only try to read files.
If files are locked with denied share, then no problem, I will read later or not.
So, this is how I access file currently:
F := TFileStream.Create(AFileName, fmOpenRead or fmShareDenyWrite);
Files can be up to 50MB, on network server, so reading could take a few seconds....
I actually have 3 questions:
1: Why are here 2 flags? Why not just fmOpenRead? What does OR mean, try one and if it doesn't work try the second one?
2: What do I need to set, to access file only read only? I can't lock the files in anyway, so if it's locked I should get a message back (any kind that will tell me I can't read the content)
3: What will happen if another process writes something in a file while I'm accessing the content? Let's say my operation lasts 3 seconds and the other process changed the content in .5s in between?
I hope 500 points is enough for all 3 questions.