Windows long path experimenting report

Adrian Buehlmann adrian at cadifra.com
Fri Jun 20 04:34:08 CDT 2008


On 20.06.2008 10:18, Patrick Mézard wrote:
> Adrian Buehlmann a écrit :
>> It seems we *can* create long path files on Windows XP using
>> \\?\.. and the ...W functions of win32file.
> 
> Interesting test. 
> 
> I think you should forget the reserved name issue for now, at worse we can solve
> it by tweaking the encoding strategy.

Well. Hrmm.... I have already said a lot on this. Not sure if it helps repeating
myself.

> What I understand about your attempts is
> long file names created with CreateFileW() are still unremovable when using Windows Explorer
> or command line tools ?

Amazing.

I just found out that I actually *can* delete my clone of http://www.cadifra.com/cgi-bin/repos/long1/
by using explorer.

But not by using command line.

I can also copy long1 to long2 by using explorer, but the copy is broken:

> hgt verify
--- running hg from W:\hg-longpath
creating file: \\?\W:\tmp\1\long2\.hg\requires
creating file: \\?\W:\tmp\1\long2\.hg\store\00changelog.i
checking changesets
creating file: \\?\W:\tmp\1\long2\.hg\store\00changelog.d
creating file: \\?\W:\tmp\1\long2\.hg\store\00changelog.i
checking manifests
creating file: \\?\W:\tmp\1\long2\.hg\store\00manifest.i
creating file: \\?\W:\tmp\1\long2\.hg\store\00manifest.d
creating file: \\?\W:\tmp\1\long2\.hg\store\00manifest.i
crosschecking files in changesets and manifests
checking files
creating file: \\?\W:\tmp\1\long2\.hg\store\data\_t_h_i_s___i_s___a_n___i_n_c_r_e_d_i_b_l_y___l_o_n_g___n_a_m_e___w_h_i_c_h___m_e_r_c_u_r_i_a_l___r_e_p_o_s
_i_t_o_r_i_e_s___w_i_l_l___h_a_v_e___a___h_a_r_d___t_i_m_e___w_i_t_h\_t_h_e___q_u_i_c_k___b_r_o_w_n___f_o_x___j_u_m_p_s___o_v_e_r___t_h_e___l_a_z_y___d_o_g
___t_h_e___q_u_i_c_k___b_r_o_w_n___f_o_x___j_u_m_p_s___a___s_e_c_o_n_d___t_i_m_e___t_h_e___q_u_i_c_k___b_r_o_w_n.txt.i
creating file: \\?\W:\tmp\1\long2\.hg\store\data\_t_h_i_s___i_s___a_n___i_n_c_r_e_d_i_b_l_y___l_o_n_g___n_a_m_e___w_h_i_c_h___m_e_r_c_u_r_i_a_l___r_e_p_o_s
_i_t_o_r_i_e_s___w_i_l_l___h_a_v_e___a___h_a_r_d___t_i_m_e___w_i_t_h\_t_h_e___q_u_i_c_k___b_r_o_w_n___f_o_x___j_u_m_p_s___o_v_e_r___t_h_e___l_a_z_y___d_o_g
___t_h_e___q_u_i_c_k___b_r_o_w_n___f_o_x___j_u_m_p_s___a___s_e_c_o_n_d___t_i_m_e___t_h_e___q_u_i_c_k___b_r_o_w_n.txt.d
creating file: \\?\W:\tmp\1\long2\.hg\store\data\_t_h_i_s___i_s___a_n___i_n_c_r_e_d_i_b_l_y___l_o_n_g___n_a_m_e___w_h_i_c_h___m_e_r_c_u_r_i_a_l___r_e_p_o_s
_i_t_o_r_i_e_s___w_i_l_l___h_a_v_e___a___h_a_r_d___t_i_m_e___w_i_t_h\_t_h_e___q_u_i_c_k___b_r_o_w_n___f_o_x___j_u_m_p_s___o_v_e_r___t_h_e___l_a_z_y___d_o_g
___t_h_e___q_u_i_c_k___b_r_o_w_n___f_o_x___j_u_m_p_s___a___s_e_c_o_n_d___t_i_m_e___t_h_e___q_u_i_c_k___b_r_o_w_n.txt.i
 THIS_IS_AN_INCREDIBLY_LONG_NAME_WHICH_MERCURIAL_REPOSITORIES_WILL_HAVE_A_HARD_TIME_WITH/THE_QUICK_BROWN_FOX_JUMPS_OVER_THE_LAZY_DOG_THE_QUICK_BROWN_FOX_JU
MPS_A_SECOND_TIME_THE_QUICK_BROWN.txt at 1: empty or missing revlog
creating file: \\?\W:\tmp\1\long2\.hg\store\data\_t_h_i_s___i_s___a_n___i_n_c_r_e_d_i_b_l_y___l_o_n_g___n_a_m_e___w_h_i_c_h___m_e_r_c_u_r_i_a_l___r_e_p_o_s
_i_t_o_r_i_e_s___w_i_l_l___h_a_v_e___a___h_a_r_d___t_i_m_e___w_i_t_h\a.txt.i
creating file: \\?\W:\tmp\1\long2\.hg\store\data\_t_h_i_s___i_s___a_n___i_n_c_r_e_d_i_b_l_y___l_o_n_g___n_a_m_e___w_h_i_c_h___m_e_r_c_u_r_i_a_l___r_e_p_o_s
_i_t_o_r_i_e_s___w_i_l_l___h_a_v_e___a___h_a_r_d___t_i_m_e___w_i_t_h\a.txt.d
creating file: \\?\W:\tmp\1\long2\.hg\store\data\_t_h_i_s___i_s___a_n___i_n_c_r_e_d_i_b_l_y___l_o_n_g___n_a_m_e___w_h_i_c_h___m_e_r_c_u_r_i_a_l___r_e_p_o_s
_i_t_o_r_i_e_s___w_i_l_l___h_a_v_e___a___h_a_r_d___t_i_m_e___w_i_t_h\a.txt.i
2 files, 2 changesets, 1 total revisions
1 integrity errors encountered!
(first damaged changeset appears to be 1)

looking into the store reveals that explorer renamed a file to
_T_H_E~1.I when it tried copying a long file.

What I definitely can't delete using explorer is a repo containing
a reserved name.

So I can't delete clones of

http://www.cadifra.com/cgi-bin/repos/auxtest/
http://www.cadifra.com/cgi-bin/repos/auxtest2/

with explorer.

> That's a real problem, I can understand Windows API and wrappers have issues with reserved
> filenames but I would have hoped they provided some fallback for long file names.

There are a lot of hopes on all sides around here. We need to know. See above.

> I mean, it seems to make this feature completely useless.

Sigh.

So what do you want to do then?

Should I abandon trying the \\?\.. thing now?





More information about the Mercurial-devel mailing list