Working with Files

Red is very well equipped to work with and manipulate files and folders easily.

As early as Chapter 3, Using Words, Values, and Types, we saw our first examples of the file! type, with its % and / syntax. From the type hierarchy, we can observe that file! is a subtype of string!, and, from there, a subtype of series!, and so all the functions we have seen for series also apply to files.

We'll encounter such examples in this chapter. But, above all, we will learn how to use files as data stores. We will examine reading and writing files, either data files, or code files. We'll develop our knowledge of the topic using an ongoing example. By the end of this chapter, you will know how to download stock quotes or other files from the internet and save them to local files.

We'll explore the following topics:

  • Selecting a file or folder
  • Working with paths and directories
  • Reading and writing data files
  • Loading and saving files
  • Downloading currency exchange rates
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.17.40