Chapter 21 Other Functions

Table of Contents
21.1 Input File
21.2 Absolute Input File
21.3 Output File
21.4 Absolute Output File
21.5 Raising Errors
21.6 Writing to Standard Output
21.7 Random numbers
21.8 Check for file existence

21.1 Input File

21.1.1 Synopsis

inputfile ()
inputfile ("prefix")

21.1.2 Description

Return name of input file.

If constant string prefix is provided, a concatenation of prefix and input file is returned. Generally, you can simply use the former syntax and concatenate the strings (prefix + inputfile()) but - if you use Cows-mkgen to create makefiles - functions introducing dependencies (verbatim (), include (), fdate (), fsize ()) need a constant string or the inputfile () and outputfile () functions.

So, the expression fdate (inputfile ("../")) is safe, while fdate ("../" + inputfile()) will result in a missing dependency. Remember that Cows-mkgen tells you about this missing dependency raising a warning.

21.1.3 Example

print (inputfile ());

Display name of input file.

This manual can be downloaded from http://www.g-cows.org/.