-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmore_sort.c
30 lines (26 loc) · 1.24 KB
/
more_sort.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* more_sort.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ihermell <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/12/03 09:13:37 by ihermell #+# #+# */
/* Updated: 2014/12/04 17:24:01 by ihermell ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_ls.h"
int sort_by_atime(t_data *data1, t_data *data2)
{
if (data2->stat->st_atime == data1->stat->st_atime)
return (sort_by_d_name(data1, data2));
return (data2->stat->st_atime - data1->stat->st_atime);
}
int sort_by_size(t_data *data1, t_data *data2)
{
return (data2->stat->st_size - data1->stat->st_size);
}
int sort_f(void)
{
return (1);
}