Skip to content

Commit f233131

Browse files
committed
Added Open method
1 parent 897bc96 commit f233131

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

paths.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,12 @@ func (p *Path) Truncate() error {
436436
return p.WriteFile([]byte{})
437437
}
438438

439+
// Open opens the named file for reading. It calls os.Open on the
440+
// underlying path.
441+
func (p *Path) Open() (*os.File, error) {
442+
return os.Open(p.path)
443+
}
444+
439445
// EqualsTo return true if both paths are equal
440446
func (p *Path) EqualsTo(other *Path) bool {
441447
return p.path == other.path

0 commit comments

Comments
 (0)