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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 15:06:41
Script start
Timing: Jan 18 2025 15:06:41
Module start 'layout'
Timing: Jan 18 2025 15:06:41
Module start 'content'
Timing: Jan 18 2025 15:06:41
Module end 'content'
Timing: Jan 18 2025 15:06:41
Script end

Main resources:

Total runtime0.0180 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0059 587.9063152.6250
Module start 'layout' 0.00590.0036 740.531339.4453
Module start 'content' 0.00960.0061 779.976693.4141
Module end 'content' 0.01570.0023 873.390634.3047
Script end 0.0180  907.6953 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002815.3404140.0002
Check MTime0.00126.4765140.0001
Mysql Total
Database connection0.00084.462410.0008
Mysqli_queries0.003318.384230.0011
Looping result0.00000.116510.0000
Template Total0.00179.410.0017
Template load0.00095.200810.0009
Template processing0.00084.201710.0008
Override
Cache load0.00063.458010.0006
General
dbfile0.00031.520580.0000
String conversion0.00000.060940.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs