mhkarimi1383 / simple-store

simply store files :)
GNU General Public License v3.0
2 stars 0 forks source link

We have lost bytes in files #5

Open mhkarimi1383 opened 1 year ago

mhkarimi1383 commented 1 year ago

In https://github.com/mhkarimi1383/simple-store/blob/fd4c211a2dc05fd24fbe043758741d0580c6ef36/internal/filemanager/filemanager.go#L34 we are chunking files and saving them is File System using os package

but there is some bytes that are losing in the middle or the last parts of the file and after saving files are being corrupted

mhkarimi1383 commented 1 year ago

here https://github.com/mhkarimi1383/simple-store/blob/789b3dbc5084cfeda9ecec5667f95acc7ed6d30d/internal/filemanager/filemanager.go#L71

if we get EOF error written value is wrong but that's not related to our problem since we are not using it for now

mhkarimi1383 commented 1 year ago

as my tests the problem is happening when you put chunk size to a big value