How to resolve the algorithm File size step by step in the Forth programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm File size step by step in the Forth programming language
Table of Contents
Problem Statement
Verify the size of a file called input.txt for a file in the current working directory, and another one in the file system root.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm File size step by step in the Forth programming language
Source code in the forth programming language
: .filesize ( addr len -- ) 2dup type ." is "
r/o open-file throw
dup file-size throw <# #s #> type ." bytes long." cr
close-file throw ;
s" input.txt" .filesize
s" /input.txt" .filesize
You may also check:How to resolve the algorithm Sorting algorithms/Shell sort step by step in the Forth programming language
You may also check:How to resolve the algorithm Guess the number/With feedback (player) step by step in the Java programming language
You may also check:How to resolve the algorithm Greatest element of a list step by step in the Burlesque programming language
You may also check:How to resolve the algorithm Hofstadter Q sequence step by step in the Forth programming language
You may also check:How to resolve the algorithm Logical operations step by step in the MUMPS programming language