Jump to content

Check that file exists: Difference between revisions

(added ocaml)
Line 186:
=={{header|Smalltalk}}==
 
SmalltalkSqueak has no notion of 'current directory' because Smalltalkit isn't tied to the shell that created it.
 
FileDirectory new fileExists: 'c:\serial'.
 
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}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.