0

I have a bunch of processes accessing and modifying a csv file from Python at the same time (safely doing so with FileLock). I access the file using the Pandas package.

I would like to launch another batch of processes which are going to access this same file (reading) but without modifying it. Can I access this file without using a locking system, and still have the first writing processes unaffected by this?

In case that it is okay to do this, will the reading of the file have to wait for a writing process to finish if it is locked?

I must note, in case that it is not clear, that I do not want the writing processes to be affected by the reading ones. However, the modifications done by the writing processes on the file are not relevant for the reading processes in my case, so I do not mind in which stage of writing they are.

Miguel
  • 96
  • 8
  • 1
    I don't see how the reading of the file can affect the processes that are writing it. However, if the processes that are also reading the file are not first locking the file, they could potentially encounter errors. – Booboo Mar 22 '22 at 12:25
  • The modifications are just lines that are appended at the end of the file, and the reading processes read by line (not by column in the csv or similar). Therefore, the first lines of the files (which are the important to read in my case) should not be affected, so I guess this processes should not encounter any errors in my specific case. – Miguel Mar 22 '22 at 14:13
  • That sounds about right. – Booboo Mar 22 '22 at 14:52

0 Answers0