<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://www.swi-prolog.org/bugzilla/bugzilla.dtd">

<bugzilla version="4.0"
          urlbase="http://www.swi-prolog.org/bugzilla/"
          
          maintainer="bugs@swi-prolog.org"
>

    <bug>
          <bug_id>37</bug_id>
          
          <creation_ts>2012-05-31 20:06:00 +0200</creation_ts>
          <short_desc>absolute_file_name/3 does not handle long windows path names properly</short_desc>
          <delta_ts>2012-06-01 14:57:42 +0200</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>SWI-Prolog</product>
          <component>core</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows</op_sys>
          <bug_status>CONFIRMED</bug_status>
          
          
          
          
          
          
          <priority>Highest</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Holger Kanwischer">holger.kanwischer</reporter>
          <assigned_to name="Jan Wielemaker">bugs</assigned_to>
          

      

      

      

          <long_desc isprivate="0">
            <commentid>108</commentid>
            <who name="Holger Kanwischer">holger.kanwischer</who>
            <bug_when>2012-05-31 20:06:06 +0200</bug_when>
            <thetext>Hi Jan,

maybe it is possible to make SWI-Prolog long-path-name-ready in
(very) small chunks :-)

Cheers
Holger

Version 6.0.2, Windows XP, 32-Bit.

3 ?- absolute_file_name(&apos;\\\\?\\d:\\tmp\\x.tmp&apos;, [], Abs).
Abs = &apos;/?/d:/tmp/x.tmp&apos;.

It should be
Abs = &apos;//?/d:/tmp/x.tmp&apos;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <commentid>109</commentid>
            <who name="Jan Wielemaker">bugs</who>
            <bug_when>2012-06-01 14:57:42 +0200</bug_when>
            <thetext>Hi Holger,

That is not entirely clear.  The idea behind absolute_file_name/2 is that it
produces a canonical name for a file.  Surely, the current answer is wrong,
but it could well be that the correct answer is d:/tmp/x.tmp.  The alternative
would be to map d:/tmp/x.tmp to //?/d:/tmp/x.tmp ...

At the moment, it is not really clear to me what the status of //?/ should be.
Its also not really clear to me what it really means.  From the docs, I understand
that it stops mapping / to \.  That is irrelevant to us because SWI-Prolog maps
/ to \.  I guess it also does something with the old 8+3 name interface, but this
is pretty much irrelevant in the Windows world as well nowadays.  

For short, can&apos;t we just strip &quot;//?/&quot;?  That doesn&apos;t fix the problem with long
pathnames, but some initial tests shows that size_file/2 stops at 260 characters,
regardless of whether one uses //?/ or not.  This seems to be a limitation of 
the MSVC runtime stat() function (we use _wstati64()), although I have not found
a document that confirms this.

Otherwise, I guess the most sensible way is for you to establish a list of issues
around the long name notation (//?/) and PATH_MAX (260 chars).

    Cheers --- Jan</thetext>
          </long_desc>
      
      

    </bug>

</bugzilla>