Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

path problem - help needed

 [1/13] from: rotenca:telvia:it at: 17-May-2003 15:44


Under windows 98 the current path reported by what-dir is something like: %/C/REBOL/VIEW/LOCAL/foobar~1/ the same happend for path names in system/script system/options but read %/C/REBOL/VIEW/LOCAL/ reports names in the extended windows form: foobarfoo/ how can i transform the first in the second or at least to know that the two names are referring to the same item of the file system? --- Ciao Romano

 [2/13] from: antonr:iinet:au at: 18-May-2003 1:41


How about: clean-path what-dir Anton.

 [3/13] from: rotenca::telvia::it at: 18-May-2003 2:48


Hi Anton,
> How about: > > clean-path what-dir
It does not work. The name remain the same, extended or unextended. Ciao Romano

 [4/13] from: philb:upnaway at: 18-May-2003 9:35


Hi Romano, Strange .... I dont see this at all under Win 98 (REBOL/View 1.2.8.3.1 3-Aug-2002) ... see console session below
>> >> make-dir %foobarfoo
== %foobarfoo/
>> change-dir %foobarfoo
== %/C/Program Files/rebol/view/foobarfoo/
>> what-dir
== %/C/Program Files/rebol/view/foobarfoo/
>>
What version of Rebol are you using? Cheers Phil === Original Message === How about: clean-path what-dir Anton.

 [5/13] from: rotenca:telvia:it at: 18-May-2003 11:55


Hi Philb, A name in the form ~1 can come from the starting dir of Rebol (if launched by another program) or from some user or database input. --- Ciao Romano

 [6/13] from: philb:upnaway at: 18-May-2003 22:52


Hi Romano, I have some docs on how windows creates the short names (for compatibility eith 16 bit ptograms) .... 1. Removes all spaces & other illeagal characters 2. Truncates the long filename to 6 charecters if necessary appends a ~ followed by a single digit. If this cerates a duplicate filename Windows increaces the digit by 1. If necessary Windows will reduce the filename to 5 characters and use ~ follwed by a 2 digit number 3. Trancates the file extension to 3 characters. If the long filename has no extension the the short filename will have no extension. 4. Changes all lowercase letters to uppercase. but conversion back to the full file name would seem to need access the long-file name (as seen in a DOS directory listing). Phil === Original Message === Hi Philb, A name in the form ~1 can come from the starting dir of Rebol (if launched by another program) or from some user or database input. --- Ciao Romano

 [7/13] from: greggirwin:mindspring at: 18-May-2003 21:23


Hi Romano, RPT> Under windows 98 the current path reported by what-dir is something like: RPT> %/C/REBOL/VIEW/LOCAL/foobar~1/ RPT> the same happend for path names in system/script system/options RPT> but RPT> read %/C/REBOL/VIEW/LOCAL/ RPT> reports names in the extended windows form: RPT> foobarfoo/ get-modes supports a 'full-path mode, which you might try. I don't know that it will work though. I'm afraid it won't map the short name to the long name for you if they're using GetFullPathName under the hood. Is the Windows API an option (i.e. GetShortPathName or FindFirstFile? -- Gregg

 [8/13] from: philb:upnaway at: 19-May-2003 13:31


Hi Gregg, I tried 'full-path mode for get-modes and it still gives the short file-name. Phil === Original Message === Hi Romano, RPT> Under windows 98 the current path reported by what-dir is something like: RPT> %/C/REBOL/VIEW/LOCAL/foobar~1/ RPT> the same happend for path names in system/script system/options RPT> but RPT> read %/C/REBOL/VIEW/LOCAL/ RPT> reports names in the extended windows form: RPT> foobarfoo/ get-modes supports a 'full-path mode, which you might try. I don't know that it will work though. I'm afraid it won't map the short name to the long name for you if they're using GetFullPathName under the hood. Is the Windows API an option (i.e. GetShortPathName or FindFirstFile? -- Gregg

 [9/13] from: nitsch-lists:netcologne at: 19-May-2003 13:56


You could create a temporary file and look in both directories. Volker [philb--upnaway--com] wrote:

 [10/13] from: rotenca:telvia:it at: 19-May-2003 15:35


Thank Phil, Gregg, Volker The API is not an option. I think it is a bug, sent to feedback. I have resolved my problem selecting an explicit starting dir in the program which launches Rebol, so the initial dir has always the full name path. But for names taken by user or database input, i do not have any solution. I feel also the lack of a sort of: same-file? %/c/rebol/view/local/ %local/ ; ==true which is different from equal? clean-path %/c/rebol/view/local/ clean-path %local/ --- Ciao Romano

 [11/13] from: antonr:iinet:au at: 20-May-2003 14:42


Can you explain this a bit more? Why is it different? Surely the same path leads to the same file? (Not necessarily in your case with the path bug, but let's assume that bug will be fixed.) Anton.

 [12/13] from: rotenca:telvia:it at: 20-May-2003 15:32


Hi Anton, I'm thinking to different path which lead to the same file: physical device against virtual device, disk name against device name, virtual path (linked) against real path. The case of window names is only one of many. -- Ciao Romano

 [13/13] from: g:santilli:tiscalinet:it at: 20-May-2003 17:45


Hi Anton, On Tuesday, May 20, 2003, 6:42:22 AM, you wrote: A> Can you explain this a bit more? A> Why is it different? A> Surely the same path leads to the same file? The same path leads to the same file, but the same file could have different paths (i.e. when you have links in the file system, or in the AmigaOS with assigns, etc.). Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r