Thrill  0.1
sys_file.hpp
Go to the documentation of this file.
1 /*******************************************************************************
2  * thrill/vfs/sys_file.hpp
3  *
4  * Part of Project Thrill - http://project-thrill.org
5  *
6  * Copyright (C) 2015 Alexander Noe <[email protected]>
7  * Copyright (C) 2015-2016 Timo Bingmann <[email protected]>
8  *
9  * All rights reserved. Published under the BSD-2 license in the LICENSE file.
10  ******************************************************************************/
11 
12 #pragma once
13 #ifndef THRILL_VFS_SYS_FILE_HEADER
14 #define THRILL_VFS_SYS_FILE_HEADER
15 
16 #include <thrill/vfs/file_io.hpp>
17 
18 #include <string>
19 
20 namespace thrill {
21 namespace vfs {
22 
23 /*!
24  * Glob a path and augment the FileList with matching file names.
25  */
26 void SysGlob(const std::string& path, const GlobType& gtype,
27  FileList& filelist);
28 
29 /*!
30  * Open file for reading and return file descriptor. Handles compressed files by
31  * calling a decompressor in a pipe, like "cat $f | gzip -dc |" in bash.
32  *
33  * \param path Path to open
34  *
35  * \param range Byte range to read. begin of range is use to seek to, end can be
36  * 0 for reading the whole file. Depending on the underlying fs, one can read
37  * past end without errors, it is not enforced.
38  */
40  const std::string& path, const common::Range& range = common::Range());
41 
42 /*!
43  * Open file for writing and return file descriptor. Handles compressed files by
44  * calling a compressor in a pipe, like "| gzip -d > $f" in bash.
45  *
46  * \param path Path to open
47  */
49 
50 } // namespace vfs
51 } // namespace thrill
52 
53 #endif // !THRILL_VFS_SYS_FILE_HEADER
54 
55 /******************************************************************************/
tlx::CountingPtr< WriteStream > WriteStreamPtr
Definition: file_io.hpp:146
GlobType
Type of objects to include in glob result.
Definition: file_io.hpp:99
WriteStreamPtr SysOpenWriteStream(const std::string &path)
Open file for writing and return file descriptor.
Definition: sys_file.cpp:414
std::basic_string< char, std::char_traits< char >, Allocator< char > > string
string with Manager tracking
Definition: allocator.hpp:220
void SysGlob(const std::string &path, const GlobType &gtype, FileList &filelist)
Glob a path and augment the FileList with matching file names.
Definition: sys_file.cpp:144
ReadStreamPtr SysOpenReadStream(const std::string &path, const common::Range &range)
Open file for reading and return file descriptor.
Definition: sys_file.cpp:323
tlx::CountingPtr< ReadStream > ReadStreamPtr
Definition: file_io.hpp:145