Sujet : Re: Problems with paths of Windows
De : aleccp (at) *nospam* yahoo.com (Luis Alejandro Muzzachiodi)
Groupes : comp.lang.tclDate : 18. May 2025, 03:36:00
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <ba04ce42-d26a-4adf-a9ac-45b5d5266e5e@yahoo.com>
References : 1 2
User-Agent : Mozilla Thunderbird
El 17/05/2025 a las 13:51, saito escribió:
On 5/17/2025 12:37 PM, Luis Alejandro Muzzachiodi wrote:
Hello,
>
I have a procedure that accepts a list of paths.
Assuming "$::env(SystemRoot)\my dir" is passed as a parameter, is there a way to process this so that it's interpreted correctly in the end?
I've tried combinations of { }, [list], [file normalize], [file nativename] but that didn't work.
(Working in Windows, tcl 8.6)
>
It is not clear what you are asking.
Are you trying to append a parameter to a list? You do "lappend mylist $parameter"
Are you trying to modify the Windows path env variable? It is just a string separated by commas: "append env(path) \;[join $mylist \;]"
The question - generalizing - is how (if it is possible) to convert a path into a valid path if passed as a parameter to a procedure in the Windows format, for example, "c:\windows\my dir".
The specific question would be:
given the following procedure
proc myproc { listofpaths } {
foreach p $listofpaths {
puts "$p - is valid? : [file isdirectory $p]"
}
}
if a parameter is passed as "$::env(SystemRoot)\my dir"
the result obtained is
C:Windowsmy - is valid? : 0
dir - is valid? : 0
Then, is there a way to convert - within the procedure - that input into a valid directory?
Alejandro