Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
misc
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
misc
Commits
ee38b888
Commit
ee38b888
authored
Mar 11, 2013
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lsRt: Выводит содержимое ./ в обратном порядке по mtime
parent
6711b7ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
bin/lsRt
bin/lsRt
+26
-0
No files found.
bin/lsRt
0 → 100755
View file @
ee38b888
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Выводит содержимое ./ в обратном порядке по mtime"""
import
os
from
time
import
strftime
,
localtime
def
main
():
lsR
=
[]
# [] of (path, stat)
for
dirpath
,
dirnames
,
filenames
in
os
.
walk
(
'.'
):
for
f
in
[
'%s/'
%
_
for
_
in
dirnames
]
+
filenames
:
_
=
'%s/%s'
%
(
dirpath
,
f
)
st
=
os
.
lstat
(
_
)
lsR
.
append
(
(
_
,
st
)
)
lsR
.
sort
(
key
=
lambda
_
:
_
[
1
].
st_mtime
)
for
_
,
st
in
lsR
:
print
strftime
(
'%Y-%m-%d %H:%M'
,
localtime
(
st
.
st_mtime
)),
_
if
__name__
==
'__main__'
:
main
()
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