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
3574e9aa
Commit
3574e9aa
authored
Aug 11, 2015
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the mount point exists up front.
parent
21ac1b6d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
mount.go
mount.go
+17
-0
No files found.
mount.go
View file @
3574e9aa
...
@@ -16,6 +16,7 @@ package fuse
...
@@ -16,6 +16,7 @@ package fuse
import
(
import
(
"fmt"
"fmt"
"os"
"golang.org/x/net/context"
"golang.org/x/net/context"
)
)
...
@@ -35,6 +36,22 @@ func Mount(
...
@@ -35,6 +36,22 @@ func Mount(
dir
string
,
dir
string
,
server
Server
,
server
Server
,
config
*
MountConfig
)
(
mfs
*
MountedFileSystem
,
err
error
)
{
config
*
MountConfig
)
(
mfs
*
MountedFileSystem
,
err
error
)
{
// Sanity check: make sure the mount point exists and is a directory. This
// saves us from some confusing errors later on OS X.
fi
,
err
:=
os
.
Stat
(
dir
)
switch
{
case
os
.
IsNotExist
(
err
)
:
return
case
err
!=
nil
:
err
=
fmt
.
Errorf
(
"Statting mount point: %v"
,
err
)
return
case
!
fi
.
IsDir
()
:
err
=
fmt
.
Errorf
(
"Mount point %s is not a directory"
,
dir
)
return
}
// Initialize the struct.
// Initialize the struct.
mfs
=
&
MountedFileSystem
{
mfs
=
&
MountedFileSystem
{
dir
:
dir
,
dir
:
dir
,
...
...
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