[p4] Windows file name length issues

Patrick Bennett patrick.bennett at inin.com
Fri Aug 17 20:25:48 PDT 2007


No, the Win32 APIs supports very long filenames (up to 32k), it's just 
that it requires some programmatic contortions that very few programs 
make, so the default 255 limit is still very commonly run into.
To use long filenames, programs have to call the Unicode versions (the 
'W' versions - ie CreateFileW) with \\?\ prepended to the path.
These longer paths have been supported since, I believe, the first 
Windows NT version (3.5 as I vaguelly recall - it was a long time ago).  
Windows 95/98/ME are limited to 255.

Patrick Bennett

David Weintraub wrote:
> On 8/17/07, Robert Cowham <robert at vaccaperna.co.uk> wrote:
>   
>> I don't think it is a Windows OS limitation, but instead an Office
>> limitation - i.e. versions of Word/Excel can't cope.
>>     
>
> I've even argued with Microsoft people on this point. NTFS can handle
> file names of upto 32K long with each component of the path having up
> to 255 characters in length. And, Windows *ALMOST* supports this.
>
> The problem is that the Windows routine that actually fetches the file
> from the computer is limited to 255 characters (253 if you include the
> directory specifier). This was true up to Windows XP. I don't know if
> the problem exists in Windows Vista or not (and because of the
> limitation in earlier versions of Windows, that might be why MS Office
> is also limited).
>
> The only way around this is to shorten the path you use. Put your
> Perforce clients directly on the root of the drive, and not in your My
> Documents folder or your desktop. These actually sit pretty deeply in
> the drive under "C:\Documents and Settings\<UserName>". This alone
> will save you somewhere between 30 to 40 characters in the file path.
>
> The other way is shortening your path in the client. Most Windows
> users map the Depot root to the root of their client, but this eats up
> a lot of file name length. By simply mapping only the part you need on
> your disk can save another 20 to 30 characters. You can also shorten
> long directory names in your depot when you map them to your client.
>
> Otherwise, this is really a limit with the OS, and there is no easy
> way around it.
>
> On 8/17/07, Robert Cowham <robert at vaccaperna.co.uk> wrote:
>   
>> I don't think it is a Windows OS limitation, but instead an Office
>> limitation - i.e. versions of Word/Excel can't cope.
>>
>> http://support.microsoft.com/kb/326039
>>
>> Thus no Vista solution!!
>>
>> Shortening Client root/mapping can help...
>>
>>
>>     
>>> -----Original Message-----
>>> From: perforce-user-bounces at perforce.com
>>> [mailto:perforce-user-bounces at perforce.com] On Behalf Of
>>> Albrecht, Matt
>>>       
>>> Sent: 17 August 2007 16:26
>>> To: perforce-user at perforce.com
>>> Subject: [p4] Windows file name length issues
>>>
>>> Recently, the Windows users at my office have started
>>> experiencing the Windows file name length limit, where, due
>>> to the length of their client root directory, the Perforce
>>> client cannot sync the file to the local client due to the
>>> total local file name length being more than 255 characters
>>> (or right around there). They are all running on Windows XP.
>>>
>>> The current answer I have is to either change the file names
>>> so that they're more compatible with everyone's system (not a
>>> good answer), or to shorten the client root (seems like a
>>> short term fix).
>>>
>>> Does anyone know of a better, long term solution, or if
>>> Perforce on Vista has the same problem?  Thanks.
>>>       
>> _______________________________________________
>> perforce-user mailing list  -  perforce-user at perforce.com
>> http://maillist.perforce.com/mailman/listinfo/perforce-user
>>
>>     
>
>
>   


-- 

*Patrick Bennett* | Software Engineer
phone & fax +1.317.715.8302 | patrick.bennett at inin.com
 
*Interactive Intelligence Inc.*
Deliberately Innovative
www.inin.com <http://www.inin.com/>




More information about the perforce-user mailing list