Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
f17c6bca
Commit
f17c6bca
authored
Aug 03, 2009
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this time really clean up a TODO
R=rsc DELTA=28 (0 added, 20 deleted, 8 changed) OCL=32676 CL=32684
parent
fe287e79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
24 deletions
+4
-24
util.go
src/cmd/gobuild/util.go
+4
-24
No files found.
src/cmd/gobuild/util.go
View file @
f17c6bca
...
...
@@ -264,36 +264,16 @@ func SourceFiles(dir string) ([]string, os.Error) {
return
out
,
nil
;
}
// TODO(rsc): Implement these for real as
// os.MkdirAll and os.RemoveAll and then
// make these wrappers that call fatal on error.
func
MkdirAll
(
name
string
)
{
p
,
err
:=
exec
.
Run
(
"/bin/mkdir"
,
[]
string
{
"mkdir"
,
"-p"
,
name
},
os
.
Environ
(),
exec
.
DevNull
,
exec
.
PassThrough
,
exec
.
PassThrough
);
err
:=
path
.
MkdirAll
(
name
);
if
err
!=
nil
{
fatal
(
"run /bin/mkdir: %v"
,
err
);
}
w
,
err1
:=
p
.
Wait
(
0
);
if
err1
!=
nil
{
fatal
(
"wait /bin/mkdir: %v"
,
err
);
}
if
!
w
.
Exited
()
||
w
.
ExitStatus
()
!=
0
{
fatal
(
"/bin/mkdir: %v"
,
w
);
fatal
(
"MkdirAll: %v"
,
err
);
}
}
func
RemoveAll
(
name
string
)
{
p
,
err
:=
exec
.
Run
(
"/bin/rm"
,
[]
string
{
"rm"
,
"-rf"
,
name
},
os
.
Environ
(),
exec
.
DevNull
,
exec
.
PassThrough
,
exec
.
PassThrough
);
if
err
!=
nil
{
fatal
(
"run /bin/rm: %v"
,
err
);
}
w
,
err
:=
p
.
Wait
(
0
);
err
:=
path
.
RemoveAll
(
name
);
if
err
!=
nil
{
fatal
(
"wait /bin/rm: %v"
,
err
);
}
if
!
w
.
Exited
()
||
w
.
ExitStatus
()
!=
0
{
fatal
(
"/bin/rm: %v"
,
w
);
fatal
(
"RemoveAll: %v"
,
err
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment