Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
3pia
VISPA
VISPA web
Commits
eef9c03a
Commit
eef9c03a
authored
Apr 05, 2014
by
Gero Müller
Browse files
handle symlinks
parent
e4c27a90
Changes
1
Hide whitespace changes
Inline
Side-by-side
vispa/remote/filesystem.py
View file @
eef9c03a
...
...
@@ -99,15 +99,18 @@ class FileSystem(object):
fullpath
=
os
.
path
.
join
(
path_expand
,
elem
)
stats
=
os
.
lstat
(
fullpath
)
is_symlink
=
stat
.
S_ISLNK
(
stats
.
st_mode
)
if
is_symlink
:
stats
=
os
.
stat
(
fullpath
)
size
=
stats
.
st_size
mtime
=
stats
.
st_mtime
if
stat
.
S_ISDIR
(
stats
.
st_mode
):
filelist
.
append
({
'name'
:
elem
,
'type'
:
'd'
,
'mtime'
:
mtime
,
'size'
:
size
})
filelist
.
append
({
'name'
:
elem
,
'symlink'
:
is_symlink
,
'type'
:
'd'
,
'mtime'
:
mtime
,
'size'
:
size
})
if
deep
:
filelist
.
extend
(
self
.
get_file_list
(
fullpath
,
deep
,
filter
,
reverse
))
else
:
filelist
.
append
({
'name'
:
elem
,
'type'
:
'f'
,
'mtime'
:
mtime
,
'size'
:
size
})
filelist
.
append
({
'name'
:
elem
,
'symlink'
:
is_symlink
,
'type'
:
'f'
,
'mtime'
:
mtime
,
'size'
:
size
})
except
Exception
,
e
:
filelist
.
append
({
'warning'
:
str
(
e
)})
...
...
Write
Preview
Supports
Markdown
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