Я пишу реализацию команды ls, но обнаружил проблему со столбцами, я хочу выровнять их как настоящий ls -l
drwx------@ 3 haxor123 candidate 102 Oct 3 14:43 Applications
drwxr-xr-x 21 haxor123 candidate 714 Nov 29 21:07 Desktop
drwxr-xr-x 4 haxor123 candidate 136 Nov 6 19:54 Documents
drwx------ 9 haxor123 candidate 306 Nov 28 22:28 Downloads
drwxr-xr-x@ 396 haxor123 candidate 13464 Nov 29 19:52 Library
drwx------+ 3 haxor123 candidate 102 Aug 9 16:38 Movies
drwx------+ 4 haxor123 candidate 136 Oct 5 14:13 Music
drwxr-xr-x 3 haxor123 candidate 102 Oct 4 23:23 PicineRe
drwxr-xr-x 4 haxor123 candidate 136 Oct 4 23:52 PicineRee
drwxr-xr-x 3 haxor123 candidate 102 Oct 4 22:32 PicineReloaded
drwx------+ 4 haxor123 candidate 136 Nov 11 16:46 Pictures
drwxr-xr-x 6 haxor123 candidate 204 Nov 12 21:38 exam-basedir
lrwxr-xr-x 1 haxor123 candidate 34 Jul 16 10:12 goinfre ->
/Volumes/Storage/goinfre/haxor123/
drwxr-xr-x 4 haxor123 candidate 136 Oct 3 15:14 s
Это часть функции ls -l
temp = list;
ft_putstr("total ");
printblocks(list);
ft_putchar('\n');
while (temp != NULL)
{
lstat(temp->full_path, &fstat);
ft_permissions(temp, fstat);
ft_putstr(" ");
bytes1 = ft_itoa(fstat.st_nlink);
ft_putstr(bytes1);
ft_putstr(get_user(fstat));
bytes = ft_itoa(fstat.st_size);
len = ft_strlen(bytes);
ft_putstr(ft_strjoin(bytes, " "));
get_time(fstat, temp);
temp = temp->next;
if (temp != NULL)
ft_putchar('\n');