Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pyfs
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
pyfs
Commits
3a283254
Commit
3a283254
authored
Apr 23, 2012
by
btimby
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure files are not treated as directories (even when they are :-)
parent
f5fca02f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
fs/expose/ftp.py
+9
-4
No files found.
fs/expose/ftp.py
View file @
3a283254
...
@@ -147,10 +147,15 @@ class FTPFS(ftpserver.AbstractedFS):
...
@@ -147,10 +147,15 @@ class FTPFS(ftpserver.AbstractedFS):
elif
'st_mtime'
in
kwargs
:
elif
'st_mtime'
in
kwargs
:
# As a last resort, just copy the modified time.
# As a last resort, just copy the modified time.
kwargs
[
'st_ctime'
]
=
kwargs
[
'st_mtime'
]
kwargs
[
'st_ctime'
]
=
kwargs
[
'st_mtime'
]
if
self
.
fs
.
isdir
(
path
):
mode
=
0777
kwargs
[
'st_mode'
]
=
0777
|
stat
.
S_IFDIR
# Merge in the type (dir or file). File is tested first, some file systems
else
:
# such as ArchiveMountFS treat archive files as directories too. By checking
kwargs
[
'st_mode'
]
=
0777
|
stat
.
S_IFREG
# file first, any such files will be only files (not directories).
if
self
.
fs
.
isfile
(
path
):
mode
|=
stat
.
S_IFREG
elif
self
.
fs
.
isdir
(
path
):
mode
|=
stat
.
S_IFDIR
kwargs
[
'st_mode'
]
=
mode
return
FakeStat
(
**
kwargs
)
return
FakeStat
(
**
kwargs
)
# No link support...
# No link support...
...
...
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