Accessing a file by Samba as it is being written to

I use my Pi as a PVR. I have use Samba (SMB) to share the drive to which the
recordings are being written. I've noticed that when Windows accesses this
shared drive while a recording is being made and the file is growing in
size, the file appears to grow in "chunks" - the size and the apparent
length (time) of the recording only changes every few minutes - sometimes an
update can be triggered by F5 (refresh Windows Explorer). It's not that the
PVR program is only updating a header infrequently, because VLC on the Pi,
accessing the file via the UNIX filesystem, can see beyond the point at
which VLC on Windows thonks the file ends. It looks as if it's a Samba
issue, as if Samba is buffering the contents. But it's not a restriction of
SMB as a whole, because if one Windows PC accesses a file using SMB that is
being written to on another Windows computer, the true up-to-the-minute size
and contents are available.
Is there a parameter in Samba on Linux which avoids this or shortens the
amount of lag? It's not the end of the world if there isn't a way. It just
means I need to wait until a recording has finished before I can rely on
being able to read the whole of the file.
Reply to
NY
Loading thread data ...
Dana Thu, 19 Aug 2021 17:32:10 +0100, NY napis'o:
It will not update header at all. THe problem is that the "index" of the video is written at the end of the file. If you don't have the end... you can only watch while it is written.
As you can also copy the file when it is completely written and than watch it on another machine and also jump through the file. Usually you cannot jump through the file if it is not written completely.
As you've written, pressinf F5 for refresh gets the latest size of the file but you will not be able to skip through the file until recorder finishes and puts the "index" at the end of the file.
Reply to
Nikolaj Lazic

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.