CHAPTER 10 FILES

The programs that we have studied have all produced some output and, in many cases, accepted some input. This has been achieved through using the standard input (keyboard) and standard output (screen). However, these simple programs are unrepresentative of many computer applications. In practice, most applications involve the permanent storage of data in a computer file. In this chapter, we consider applications that process files.

10.1 COMMAND LINE ARGUMENTS

A Groovy program exists in an environment established by the operating system. The environment supports passing command line arguments to a program when it begins execution. In a Groovy script, such as that in Example 01, these arguments can be accessed by the args variable, ...

Get Groovy Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.