Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
577b8ef2
Commit
577b8ef2
authored
Mar 13, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 13, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmd.exe: Add DIR /T support.
parent
729ed862
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
directory.c
programs/cmd/directory.c
+34
-1
No files found.
programs/cmd/directory.c
View file @
577b8ef2
...
...
@@ -39,8 +39,16 @@ extern int echo_mode;
extern
char
quals
[
MAX_PATH
],
param1
[
MAX_PATH
],
param2
[
MAX_PATH
];
extern
DWORD
errorlevel
;
typedef
enum
_DISPLAYTIME
{
Creation
=
0
,
Access
,
Written
}
DISPLAYTIME
;
static
int
file_total
,
dir_total
,
recurse
,
wide
,
bare
,
max_width
,
lower
;
static
ULONGLONG
byte_total
;
static
DISPLAYTIME
dirTime
;
/*****************************************************************************
* WCMD_directory
...
...
@@ -55,9 +63,11 @@ void WCMD_directory (void) {
int
status
,
paged_mode
;
ULARGE_INTEGER
avail
,
total
,
free
;
CONSOLE_SCREEN_BUFFER_INFO
consoleInfo
;
char
*
p
;
byte_total
=
0
;
file_total
=
dir_total
=
0
;
dirTime
=
Written
;
/* Handle args */
paged_mode
=
(
strstr
(
quals
,
"/P"
)
!=
NULL
);
...
...
@@ -66,6 +76,23 @@ void WCMD_directory (void) {
bare
=
(
strstr
(
quals
,
"/B"
)
!=
NULL
);
lower
=
(
strstr
(
quals
,
"/L"
)
!=
NULL
);
if
((
p
=
strstr
(
quals
,
"/T"
))
!=
NULL
)
{
p
=
p
+
2
;
if
(
*
p
==
':'
)
p
++
;
/* Skip optional : */
if
(
*
p
==
'A'
)
dirTime
=
Access
;
else
if
(
*
p
==
'C'
)
dirTime
=
Creation
;
else
if
(
*
p
==
'W'
)
dirTime
=
Written
;
/* Support /T and /T: with no parms, default to written */
else
if
(
*
p
==
'/'
)
dirTime
=
Written
;
else
{
SetLastError
(
ERROR_INVALID_PARAMETER
);
WCMD_print_error
();
return
;
}
}
/* Handle conflicting args and initialization */
if
(
bare
)
wide
=
FALSE
;
...
...
@@ -212,7 +239,13 @@ void WCMD_list_directory (char *search_path, int level) {
while
(
(
*
p
=
tolower
(
*
p
))
)
++
p
;
}
FileTimeToLocalFileTime
(
&
(
fd
+
i
)
->
ftLastWriteTime
,
&
ft
);
if
(
dirTime
==
Written
)
{
FileTimeToLocalFileTime
(
&
(
fd
+
i
)
->
ftLastWriteTime
,
&
ft
);
}
else
if
(
dirTime
==
Access
)
{
FileTimeToLocalFileTime
(
&
(
fd
+
i
)
->
ftLastAccessTime
,
&
ft
);
}
else
{
FileTimeToLocalFileTime
(
&
(
fd
+
i
)
->
ftCreationTime
,
&
ft
);
}
FileTimeToSystemTime
(
&
ft
,
&
st
);
GetDateFormat
(
0
,
DATE_SHORTDATE
,
&
st
,
NULL
,
datestring
,
sizeof
(
datestring
));
...
...
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