Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On System Programming with Go

You're reading from   Hands-On System Programming with Go Build modern and concurrent applications for Unix and Linux systems using Golang

Arrow left icon
Product type Paperback
Published in Jul 2019
Publisher Packt
ISBN-13 9781789804072
Length 458 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alex Guerrieri Alex Guerrieri
Author Profile Icon Alex Guerrieri
Alex Guerrieri
Arrow right icon
View More author details
Toc

Table of Contents (24) Chapters Close

Preface 1. Section 1: An Introduction to System Programming and Go FREE CHAPTER
2. An Introduction to System Programming 3. Unix OS Components 4. An Overview of Go 5. Section 2: Advanced File I/O Operations
6. Working with the Filesystem 7. Handling Streams 8. Building Pseudo-Terminals 9. Section 3: Understanding Process Communication
10. Handling Processes and Daemons 11. Exit Codes, Signals, and Pipes 12. Network Programming 13. Data Encoding Using Go 14. Section 4: Deep Dive into Concurrency
15. Dealing with Channels and Goroutines 16. Synchronization with sync and atomic 17. Coordination Using Context 18. Implementing Concurrency Patterns 19. Section 5: A Guide to Using Reflection and CGO
20. Using Reflection 21. Using CGO 22. Assessments 23. Other Books You May Enjoy

Summary

In this chapter, we looked at an overview of how to execute file operations in Go. In order to locate files, an extensive array of functions are offered by the filepath package. These can help you execute all kind of operations, from composing paths to extracting elements from it.

We also looked at how to read an operation using various methods, from the easiest and less memory efficient ones that are located in the io/ioutil package to the ones that require an io.Writer implementation to read a fixed chunk of bytes. The importance of the ability to peek content, as implemented in the bufio package, allows for a whole set of operations like read word or read line, which stop the reading operation when a token is found. There are other interfaces that are satisfied by files that are very useful; for example, io.Closer ensures that the resource is...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime