Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
jacobsa-fuse
Commits
4fc546bd
Commit
4fc546bd
authored
May 09, 2017
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic_fs.go: reflow text.
parent
6a1014cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
samples/dynamicfs/dynamic_fs.go
samples/dynamicfs/dynamic_fs.go
+15
-12
No files found.
samples/dynamicfs/dynamic_fs.go
View file @
4fc546bd
...
...
@@ -17,20 +17,23 @@ import (
"github.com/jacobsa/timeutil"
)
// Create a file system that contains 2 files (`age` and `weekday`) and no directories. Every time
// the `age` file is opened, its contents are refreshed to show the number of seconds elapsed since
// the file system was created (as opposed to mounted). Every time the `weekday` file is opened, its
// contents are refreshed to reflect the current weekday.
// Create a file system that contains 2 files (`age` and `weekday`) and no
// directories. Every time the `age` file is opened, its contents are refreshed
// to show the number of seconds elapsed since the file system was created (as
// opposed to mounted). Every time the `weekday` file is opened, its contents
// are refreshed to reflect the current weekday.
//
// The contents of both of these files is updated within the filesystem itself, i.e., these changes
// do not go through the kernel. Additionally, file access times are not updated and file size is
// not known in advance and is set to 0. This simulates a filesystem that is backed by a dynamic
// data source where file metadata is not necessarily known before the file is read. For example,
// a filesystem backed by an expensive RPC or by a stream that's generated on the fly might not
// know data size ahead of time.
// The contents of both of these files is updated within the filesystem itself,
// i.e., these changes do not go through the kernel. Additionally, file access
// times are not updated and file size is not known in advance and is set to 0.
// This simulates a filesystem that is backed by a dynamic data source where
// file metadata is not necessarily known before the file is read. For example,
// a filesystem backed by an expensive RPC or by a stream that's generated on
// the fly might not know data size ahead of time.
//
// This implementation depends on direct IO in fuse. Without it, all read operations are suppressed
// because the kernel detects that they read beyond the end of the files.
// This implementation depends on direct IO in fuse. Without it, all read
// operations are suppressed because the kernel detects that they read beyond
// the end of the files.
func
NewDynamicFS
(
clock
timeutil
.
Clock
)
(
server
fuse
.
Server
,
err
error
)
{
createTime
:=
clock
.
Now
()
fs
:=
&
dynamicFS
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment