You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
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).]
There are no atheists in a fox hole or the morning of a math test.
If my flag offends you, I'll help you pack.
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.
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!
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:
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?
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Comment