Skip to content

Commit ae9722a

Browse files
committed
Added Create method
1 parent 6c2c2da commit ae9722a

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
@@ -442,6 +442,12 @@ func (p *Path) Open() (*os.File, error) {
442442
return os.Open(p.path)
443443
}
444444

445+
// Create creates or truncates a file. It calls os.Create
446+
// on the underlying path.
447+
func (p *Path) Create() (*os.File, error) {
448+
return os.Create(p.path)
449+
}
450+
445451
// EqualsTo return true if both paths are equal
446452
func (p *Path) EqualsTo(other *Path) bool {
447453
return p.path == other.path

0 commit comments

Comments
 (0)