]> mj.ucw.cz Git - libucw.git/blobdiff - lib/fb-direct.c
fb-direct: Implemented temporary files.
[libucw.git] / lib / fb-direct.c
index a4277ec929506c760aead5f8f70dc733536c207d..9262e7e156b952663d4be78b44397c06aa977ea0 100644 (file)
@@ -356,6 +356,18 @@ fbdir_open_fd(int fd, struct asio_queue *q)
   return fbdir_open_internal(x, fd, q);
 }
 
+struct fastbuf *
+fbdir_open_tmp(struct asio_queue *q)
+{
+  byte buf[TEMP_FILE_NAME_LEN];
+  struct fastbuf *f;
+
+  temp_file_name(buf);
+  f = fbdir_open(buf, O_RDWR | O_CREAT | O_TRUNC, q);
+  bconfig(f, BCONFIG_IS_TEMP_FILE, 1);
+  return f;
+}
+
 #ifdef TEST
 
 #include "lib/getopt.h"