How to resolve the algorithm Check that file exists step by step in the Gambas programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Check that file exists step by step in the Gambas programming language

Table of Contents

Problem Statement

Verify that a file called     input.txt     and   a directory called     docs     exist.

This should be done twice:

Optional criteria (May 2015):   verify it works with:

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Check that file exists step by step in the Gambas programming language

Source code in the gambas programming language

Public Sub Main()

If Exist(User.Home &/ "input.txt") Then Print "'input.txt' does exist in the Home folder"
If Not Exist("/input.txt") Then Print "'input.txt' does NOT exist in Root"                'Not messing With my Root files

If Exist(User.home &/ "docs/") Then Print "The folder '~/docs' does exist"
If Not Exist("/docs/") Then Print "The folder '/docs' does NOT exist"                     'Not messing With my Root files

File.Save(User.Home &/ "`Abdu'l-Bahá.txt", "")
If Exist(User.Home &/ "`Abdu'l-Bahá.txt") Then Print "'`Abdu'l-Bahá.txt' does exist (zero length and unusual name)"

End

  

You may also check:How to resolve the algorithm Tau function step by step in the Clojure programming language
You may also check:How to resolve the algorithm Hailstone sequence step by step in the 11l programming language
You may also check:How to resolve the algorithm Population count step by step in the Ol programming language
You may also check:How to resolve the algorithm Loops/N plus one half step by step in the 11l programming language
You may also check:How to resolve the algorithm Thue-Morse step by step in the Tcl programming language