Page 1 of 1

macOS-like truncation of filenames

Posted: 17 Mar 2020 22:35
by John_C
On Windows, when the filename is too long, it truncates on the right side:

Code: Select all

a very long filename
a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z.txt
will be displayed as
a_b_c_d_e_f_g_h_i_j...
On macOS, it will be something like

Code: Select all

a_b_c_d...w_x_y_z.txt
That is, the truncation performed in the middle.

Re: macOS-like truncation of filenames

Posted: 23 Mar 2020 18:24
by admin
What's the advantage? Seeing the extension? Seeing the end of the base name? Yes, that might be a good idea. What do others think?

Re: macOS-like truncation of filenames

Posted: 23 Mar 2020 18:42
by klownboy
I don't use a Apple product other than an iPad occasionally I got as a steep discount. It's a good idea in my opinion, since as you mentioned, you're able to see the file extension. That's an important part in seeing a long filename especially when some folders have identical file base names with different extensions.

Re: macOS-like truncation of filenames

Posted: 23 Mar 2020 18:54
by admin
I personally have the Ext column always visible so I don't need to see the extension here. But I often have interesting info at the end of the base name, like dates or serial numbers. So I would welcome that truncation option as well.

Re: macOS-like truncation of filenames

Posted: 23 Mar 2020 19:20
by Marco
admin wrote: 23 Mar 2020 18:54 I personally have the Ext column always visible so I don't need to see the extension here. But I often have interesting info at the end of the base name, like dates or serial numbers. So I would welcome that truncation option as well.
Very same here, so definitely +1

Re: macOS-like truncation of filenames

Posted: 24 Mar 2020 13:37
by admin
Done. 8)

Re: macOS-like truncation of filenames

Posted: 24 Mar 2020 18:01
by klownboy
I like it especially since I don't use an "ext" column. It's allows me to cut down the size of the name column a bit. :tup:

Re: macOS-like truncation of filenames

Posted: 24 Mar 2020 19:51
by prino
Funny, this is what PL/I on z/OS has been doing, for about a zillion years, with names that are too long for the limit (7 chars) on external names:

Code: Select all

CSECTCUT(n)
The CSECTCUT option controls how the compiler, when processing the CSECT
option, handles long names.

The CSECTCUT option has no effect unless you specify the CSECT option. It also
has no effect if the "package name" used by the CSECT option has 7 or fewer
characters.
The value n in the CSECTCUT option must be between 0 and 7, the default is 4.

If the "package name" used by the CSECT option has more than 7 characters, the
compiler will collapse the name to 7 characters by taking the first n and last 7 - n
characters.

For example, consider a compilation consisting of one procedure with the name
BEISPIEL:

v Under CSECTCUT(3), the compiler collapses the name to BEIPIEL.
v Under CSECTCUT(4), the compiler collapses the name to BEISIEL.