Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
c0420307
Commit
c0420307
authored
Jun 27, 2018
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d793fdaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
+14
-3
wcfs/__init__.py
wcfs/__init__.py
+7
-2
wcfs/wcfs.go
wcfs/wcfs.go
+7
-1
No files found.
wcfs/__init__.py
View file @
c0420307
...
...
@@ -26,9 +26,11 @@ XXX doc
import
os
,
sys
,
hashlib
,
tempfile
,
subprocess
,
time
import
logging
as
log
from
os.path
import
dirname
from
golang
import
go
,
chan
,
select
,
default
from
errno
import
ENOENT
,
EEXIST
from
golang
import
go
,
chan
,
select
,
default
from
golang.gcompat
import
qq
from
ZODB.FileStorage
import
FileStorage
...
...
@@ -162,6 +164,9 @@ def _start(zurl):
else
:
# TODO read .wcfs and verify it = zurl
res
=
f
dotwcfs
=
f
.
read
()
if
dotwcfs
!=
zurl
:
raise
RuntimeError
(
".wcfs != zurl (%s != %s)"
%
(
qq
(
dotwcfs
),
qq
(
zurl
)))
break
...
...
@@ -228,7 +233,7 @@ def _mntpt_4zurl(zurl):
_mkdir_p
(
mntpt
)
return
mntpt
# mkdir -p
# mkdir -p
.
def
_mkdir_p
(
path
):
try
:
os
.
makedirs
(
path
)
...
...
wcfs/wcfs.go
View file @
c0420307
...
...
@@ -263,6 +263,12 @@ func NewStaticFile(data []byte) *StaticFile {
return
&
StaticFile
{
Node
:
nodefs
.
NewDefaultNode
(),
data
:
data
}
}
func
(
f
*
StaticFile
)
GetAttr
(
out
*
fuse
.
Attr
,
_
nodefs
.
File
,
_
*
fuse
.
Context
)
fuse
.
Status
{
out
.
Size
=
uint64
(
len
(
f
.
data
))
out
.
Mode
=
fuse
.
S_IFREG
|
0644
return
fuse
.
OK
}
func
(
f
*
StaticFile
)
Read
(
_
nodefs
.
File
,
dest
[]
byte
,
off
int64
,
_
*
fuse
.
Context
)
(
fuse
.
ReadResult
,
fuse
.
Status
)
{
l
:=
int64
(
len
(
f
.
data
))
end
:=
off
+
l
...
...
@@ -286,7 +292,7 @@ func mkfile(parent nodefs.Node, name string, child nodefs.Node) {
func
main
()
{
log
.
SetPrefix
(
"wcfs: "
)
debug
:=
flag
.
Bool
(
"d"
,
fals
e
,
"debug"
)
debug
:=
flag
.
Bool
(
"d"
,
tru
e
,
"debug"
)
flag
.
Parse
()
if
len
(
flag
.
Args
())
!=
2
{
log
.
Fatalf
(
"Usage: %s zurl mntpt"
,
os
.
Args
[
0
])
...
...
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