Anonymous user
Check that file exists: Difference between revisions
→{{header|Smalltalk}}
(added ocaml) |
|||
Line 186:
=={{header|Smalltalk}}==
FileDirectory new fileExists: 'c:\serial'.▼
(FileDirectory on: 'c:\') directoryExists: 'docs'.
In GNU Smalltalk instead you can do:
(Directory name: 'c:\docs') exists ifTrue: [ ... ]
(File name: 'c:\serial') isFile ifTrue: [ ... ]
Using ''exists'' in the latter case will return true for directories too.
=={{header|Tcl}}==
|