MCPcopy Create free account
hub / github.com/coreutils/coreutils / print_current_files

Function print_current_files

src/ls.c:4063–4103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4061/* List all the files now in the table. */
4062
4063static void
4064print_current_files (void)
4065{
4066 switch (format)
4067 {
4068 case one_per_line:
4069 for (idx_t i = 0; i < cwd_n_used; i++)
4070 {
4071 print_file_name_and_frills (sorted_file[i], 0);
4072 putchar (eolbyte);
4073 }
4074 break;
4075
4076 case many_per_line:
4077 if (! line_length)
4078 print_with_separator (' ');
4079 else
4080 print_many_per_line ();
4081 break;
4082
4083 case horizontal:
4084 if (! line_length)
4085 print_with_separator (' ');
4086 else
4087 print_horizontal ();
4088 break;
4089
4090 case with_commas:
4091 print_with_separator (',');
4092 break;
4093
4094 case long_format:
4095 for (idx_t i = 0; i < cwd_n_used; i++)
4096 {
4097 set_normal_color ();
4098 print_long_format (sorted_file[i]);
4099 dired_outbyte (eolbyte);
4100 }
4101 break;
4102 }
4103}
4104
4105/* Replace the first %b with precomputed aligned month names.
4106 Note on glibc-2.7 at least, this speeds up the whole 'ls -lU'

Callers 2

mainFunction · 0.85
print_dirFunction · 0.85

Calls 7

print_with_separatorFunction · 0.85
print_many_per_lineFunction · 0.85
print_horizontalFunction · 0.85
set_normal_colorFunction · 0.85
print_long_formatFunction · 0.85
dired_outbyteFunction · 0.85

Tested by

no test coverage detected