|
|
|
|
@ -19,7 +19,7 @@ from tornado import web
|
|
|
|
|
from .filecheckpoints import FileCheckpoints
|
|
|
|
|
from .fileio import FileManagerMixin
|
|
|
|
|
from .manager import ContentsManager
|
|
|
|
|
from ...utils import f_stat, WINDOWS_CONTAINER, exists
|
|
|
|
|
from ...utils import exists
|
|
|
|
|
|
|
|
|
|
from ipython_genutils.importstring import import_item
|
|
|
|
|
from traitlets import Any, Unicode, Bool, TraitError, observe, default, validate
|
|
|
|
|
@ -227,7 +227,7 @@ class FileContentsManager(FileManagerMixin, ContentsManager):
|
|
|
|
|
def _base_model(self, path):
|
|
|
|
|
"""Build the common base of a contents model"""
|
|
|
|
|
os_path = self._get_os_path(path)
|
|
|
|
|
info = f_stat(os_path)
|
|
|
|
|
info = os.lstat(os_path)
|
|
|
|
|
last_modified = tz.utcfromtimestamp(info.st_mtime)
|
|
|
|
|
created = tz.utcfromtimestamp(info.st_ctime)
|
|
|
|
|
# Create the base model.
|
|
|
|
|
@ -277,7 +277,7 @@ class FileContentsManager(FileManagerMixin, ContentsManager):
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
st = f_stat(os_path)
|
|
|
|
|
st = os.lstat(os_path)
|
|
|
|
|
except OSError as e:
|
|
|
|
|
# skip over broken symlinks in listing
|
|
|
|
|
if e.errno == errno.ENOENT:
|
|
|
|
|
@ -286,7 +286,7 @@ class FileContentsManager(FileManagerMixin, ContentsManager):
|
|
|
|
|
self.log.warning("Error stat-ing %s: %s", os_path, e)
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
|
|
if (not WINDOWS_CONTAINER
|
|
|
|
|
if (not stat.S_ISLNK(st.st_mode)
|
|
|
|
|
and not stat.S_ISREG(st.st_mode)
|
|
|
|
|
and not stat.S_ISDIR(st.st_mode)):
|
|
|
|
|
self.log.debug("%s not a regular file", os_path)
|
|
|
|
|
|