afero
afero copied to clipboard
Directory buffering in MemMapFs.Readdir
os.File.Readdir
under the hood uses buffering of directory contents, which gives it ability to traverse directory and remove files at the same time. Currently, MemMapFs.Readdir
retrieves files from f.fileData.memDir.Files()
on each call, which means that if one tries to remove a file between Readdir
calls, f.readDirCount
won't be relevant and in some cases slice bounds might be violated.