Anonymous user
Check that file exists: Difference between revisions
no edit summary
No edit summary |
|||
Line 60:
if exist docs echo The following directory called docs exists.
if exist \docs\ echo The following directory called \docs\ exists.
==[[Tcl]]==
[[Category:Tcl]]
Taking the meaning of the task from the DOS example:
if { [file exists input.txt] } { puts "input.txt exists" }
if { [file exists [file nativename /input.txt]] } { puts "/input.txt exists" }
if { [file isdirectory docs] } { puts "docs exists and is a directory" }
if { [file isdirectory [file nativename /docs]] } { puts "/docs exists and is a directory" }
|