1.1 --- a/libfsserver/lib/files/host_file_accessor.cc Thu Apr 22 00:12:16 2021 +0200
1.2 +++ b/libfsserver/lib/files/host_file_accessor.cc Sat Apr 24 23:15:21 2021 +0200
1.3 @@ -26,14 +26,14 @@
1.4
1.5 #include "host_file_accessor.h"
1.6
1.7 -HostFileAccessor::HostFileAccessor(const char *path, fileid_t fileid)
1.8 -: Accessor(fileid), _path(path)
1.9 +HostFileAccessor::HostFileAccessor(FILE *fp, fileid_t fileid)
1.10 +: Accessor(fileid), _fp(fp)
1.11 {
1.12 /* Initialise the size of the file. */
1.13
1.14 struct stat buf;
1.15
1.16 - if (!stat(_path, &buf))
1.17 + if (!fstat(fileno(fp), &buf))
1.18 _size = buf.st_size;
1.19 else
1.20 _size = 0;
1.21 @@ -60,13 +60,6 @@
1.22 fclose(_fp);
1.23 }
1.24
1.25 -/* Perform any opening operation on the file. */
1.26 -
1.27 -void HostFileAccessor::open()
1.28 -{
1.29 - _fp = fopen(_path, "r");
1.30 -}
1.31 -
1.32 /* Data transfer helper methods. */
1.33
1.34 void HostFileAccessor::fill_populated(Flexpage *flexpage)