Announcement

Collapse
No announcement yet.

file names with ~

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

  • Sebastian Groeneveld
    replied
    Unfortunately my knowledge of absolute disk reading is not sufficient to use it
    for this unit. I've been looking too for a tool that can handle long filenames in
    plain DOS. And there are some nice TSR utilities that do the job... The purpose of
    this unit was to provide a single function call that would work for both long filenames
    in Win95 and short filenames in Win95 or plain DOS. However, there's also a function
    that converts any given long filename to a proper 8.3 format (optionally using "~1"
    stuff)...

    In conclusion, the unit uses many routines that can also be found in WinLib, and
    therefore needs Win95 be running in the background.

    A question for people running Win2k or WinNT:
    The following code will only detect Win9x, not WinNT/2k:
    Code:
      ! mov   ax, &H1600
      ! int   &H2F
      ! cmp   al, 4
      ! jnz   NotWin95
    However, Lance has shown a trick to detect WinNT/2k:
    Code:
      IF UCASE$(ENVIRON$("OS")) = "WINDOWS_NT" THEN
          FUNCTION = -1
          EXIT FUNCTION
      END IF
    Now my question:
    Will the other functions in WinLib (getting the LFN/SFN, switching to fullscreen,
    etc...) work properly under WinNT/2k... in other words, is it useful to add this
    'Lance-trick' to the Win95Check, that is used to verify that the LFN/SFN functions
    can be used?

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

    [This message has been edited by Sebastian Groeneveld (edited December 19, 2000).]

    Leave a comment:


  • Lance Edmonds
    replied
    Sounds interesting! There are a few examples of LFN handling around, including one in the FILES section of this web site.

    Will your library require Windows to be running in order to function, or will it work with plain DOS (boot to MSDOS) mode?


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

    Leave a comment:


  • Sebastian Groeneveld
    replied
    In case people are interested... I've made a unit that 'replaces' the OPEN, CLOSE,
    KILL, NAME etc. from PowerBasic and supports long filenames. It's nearly finished
    It has some other really useful file-related abilities. The unit will be part of a
    collection of units I will release for free on my homepage soon...
    Mail me if you're interested

    The release will be announced at the Third Party Add-On forum, so watch for it!


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

    Leave a comment:


  • Matthias Kuhn
    replied
    Sorry Mel and Lance,

    I`ve made a mistake: the tide Charakter "~" chr$(126)
    is the right one.

    I use Win 95 and it is possible to open file in those directories
    with pb 3.5.

    Regards

    Matthias Kuhn


    ------------------

    Leave a comment:


  • Lance Edmonds
    replied
    It is important to note that the tilde character (~) is the _default_ character used by Windows to convert long files names to short file names, but that character can be changed by a registry "hack".

    I'm afraid I don't have any code to query the character that is in use by Windows, however, since every Windows' installation includes a directory called "Program Files", it should be possible to use A$ = DIR$("PROGRA?1",16) to return that directory name and then check the character used in the 7th position. While this is not guaranteed to be fool-proof, it may help with a useful solution.


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

    Leave a comment:


  • Mel Bishop
    replied
    Depending on what operating system you are using, the tiddle "~"
    may be a reserved character. Windows 95 and up uses it to
    associate the 8x3 short file name with the long file name. The
    operating system may not allow the use of that character with
    user defined file names.

    It may also be that the sub-directory doesn't exist or stray
    characters may be in the file name.

    ------------------


    [This message has been edited by Mel Bishop (edited December 17, 2000).]

    Leave a comment:


  • Matthias Kuhn
    started a topic file names with ~

    file names with ~

    Hello how to open...

    open "O",1,"C:\testho~1\myfile.txt"

    The error "file not found" occurs.

    Thanks for answere.

    Matthias Kuhn

    ------------------
Working...
X