Check that file exists: Difference between revisions
Content added Content deleted
(added ocaml) |
|||
Line 186: | Line 186: | ||
=={{header|Smalltalk}}== |
=={{header|Smalltalk}}== |
||
Squeak has no notion of 'current directory' because it isn't tied to the shell that created it. |
|||
⚫ | |||
⚫ | |||
(FileDirectory on: 'c:\') directoryExists: 'docs'. |
(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}}== |
=={{header|Tcl}}== |