Forums / General / Long path names on Windows

Long path names on Windows

Author Message

Jo Henrik Endrerud

Friday 19 June 2009 12:00:10 am

I'm running a system on a Windows server and is having some problems with the image system. As Windows has a limitation of relative path names on 256 characters, it refuses some of the images on some objects deep down in the content tree.

As ImageMagick runs something like:
convert -options var/siteaccess/storage/my/long-folder/another-long-folder/a-third-long-folder/several-characters-here/yada-yada-yada/......../my-object.jpg it will fail if the path gets too long and no image will be shown.

Does anyone know anyway around this? My experience with eZ on the Windows platform is limited, but I was hoping for a setting in eZ somewhere to solve this problem.

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

André R.

Friday 19 June 2009 12:40:13 am

There is no setting.
You can try to change the code that generates that command to use absolute path instead, I think I read somewhere that the limit is bigger on absolute paths.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Jo Henrik Endrerud

Friday 19 June 2009 12:46:32 am

That was my Plan B, but I prefer to avoid changes in the core unless I have to. I seem to remember Bård telling at a conference a year or two ago that eZ was going to fully support the MS platform, but I guess that hasn't happened.

Thanks for the quick reply.

Jo Henrik Endrerud | System Developer @ Seeds Consulting | http://www.seeds.no

André R.

Friday 19 June 2009 1:34:12 am

Ignore the absolute stuff, can't seem to find it, so I probably remember wrong.
Here is something from msdn:

The Windows API has many functions that also have Unicode versions to permit an extended-length path for a maximum total path length of 32,767 characters. This type of path is composed of components separated by backslashes, each up to the value returned in the lpMaximumComponentLength parameter of the GetVolumeInformation function. To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\<very long path>". (The characters < > are used here for visual clarity and cannot be part of a valid path string.)

Note  The maximum path of 32,767 characters is approximate, because the "\\?\" prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.

http://msdn.microsoft.com/en-us/library/aa365247.aspx

But I'm unsure if it is possible to take advantage of that in php, and furthermore its a hack.
Since other file systems have similar limits, the real solution will be to revise all files system paths generated in eZ Publish, witch is a task currently on the road map for 4.2.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom