File Operations in Go: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 9: Line 9:


File paths and names should be manipulated with the functions exposed by the <code>[[Go Package path#Overview|path]]</code> and <code>[[Go Package path/filepath#Overview|path/filepath]]</code> packages.
File paths and names should be manipulated with the functions exposed by the <code>[[Go Package path#Overview|path]]</code> and <code>[[Go Package path/filepath#Overview|path/filepath]]</code> packages.
{{Internal|File Paths and Names in Go#Overview|File Paths and Names in Go}}

Revision as of 22:09, 16 October 2023

Internal

Overview

The os package provides practical file access functions. Basic file read and write, by reading or writing the entire file into and from memory, is also provided by the ioutil package, but its ioutil.ReadFile and ioutil.WriteFile are deprecated since Go 1.16.

File paths and names should be manipulated with the functions exposed by the path and path/filepath packages.

File Paths and Names in Go