Check that file exists: Difference between revisions
Content added Content deleted
m (reordering after lang rename) |
(+Icon+Unicon) |
||
Line 359: | Line 359: | ||
! ... |
! ... |
||
99 WRITE(Messagebox='!') 'File does not exist. Error message ', ios </lang> |
99 WRITE(Messagebox='!') 'File does not exist. Error message ', ios </lang> |
||
== Icon and Unicon == |
|||
==={{header|Icon}}=== |
|||
Icon doesn't support 'stat'; however, information can be obtained by use of the system function to access command line. |
|||
==={{header|Unicon}}=== |
|||
<lang Unicon>every dir := !["./","/"] do { |
|||
write("file ", f := dir || "input.txt", if stat(f) then " exists." else " doesn't exist.") |
|||
write("directory ", f := dir || "docs", if stat(f) then " exists." else " doesn't exist.") |
|||
}</lang> |
|||
Note: Icon and Unicon accept both / and \ for directory separators. |
|||
=={{header|J}}== |
=={{header|J}}== |