Announcement

Collapse
No announcement yet.

CURDIR$ with long directory entries

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • CURDIR$ with long directory entries

    I noticed CURDIR$ cannot handle 'very long' directory entries... Imagine someone has a directory:
    C:\DIR00001\DIR00002\DIR00003\DIR00004\DIR00005\DIR00006\DIR00007\DIR00008\
    I know this doesn't happen often, but DOS allows it, so the program should allow it too. If we are
    in this directory and ask for the value of CURDIR$, error 68 (device unavailable) occurs.
    The error only occurs when the SHORT directory name exceeds 66 characters, independent on the number
    of levels deep.
    What is happening? What does the error mean in this case? And does CURDIR$ use the DOS interrupt?


    -------------
    Sebastian Groeneveld
    mailto:[email protected][email protected]</A>
    Sebastian Groeneveld
    mailto:[email protected][email protected]</A>

  • #2
    Interesting observation. I don't know what CURDIR$ uses internally, but it has to use a DOS interrupt because it cannot just guess the current directory

    I'll ask R&D about it, and request that it is added to the "to do" list.


    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment


    • #3
      Ok, R&D have advised me that CURDIR$ is limited by the ability of (DOS) INT &H21, Function &H47 - it has a limit of 63 or 64 bytes (depending on how the particular implementation of that interrupt handles the trailing NUL byte in an ASCIIZ string).

      If the path is longer than 63/64 characters, then CURDIR$ will fail and signal an ERROR 68. In summary, CURDIR$ works within the limits of the operating system - there is no bug to fix here.

      However, it appears that the PowerBASIC IDE does _not_ verify the return results from the interrupt call, so it returns an 'undefined' current directory string.

      I've asked R&D to add this to the "to do" list for the IDE in the next version of PB/DOS.

      Thanks for bringing it to our attention!


      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected]rbasic.com[email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        Originally posted by Lance Edmonds:

        However, it appears that the PowerBASIC IDE does _not_ verify the return results from the interrupt call, so it returns an 'undefined' current directory string.

        I've asked R&D to add this to the "to do" list for the IDE in the next version of PB/DOS.

        If that is a possible "to do" list, why not include FAT32 support as well?

        ------------------
        Walt Decker

        Comment


        • #5
          It's only an IDE issue not a compiler issue. However, I'll pass your suggestion along.




          ------------------
          Lance
          PowerBASIC Support
          mailto:[email protected][email protected]</A>
          Lance
          mailto:[email protected]

          Comment

          Working...
          X