Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

Commit

Permalink
Fixup filenames for windows clients, add partition number to output path
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmey committed Jul 22, 2015
1 parent acbe1bc commit 8d4a670
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 7 additions & 0 deletions filename.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// +build !windows

package main

func fixFilename(name string) string {
return name
}
10 changes: 10 additions & 0 deletions filename_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package main

import (
"strings"
)

func fixFilename(name string) string {
name = strings.Replace(name, ":", "_", -1)
return name
}
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func main() {
continue
}

outFile := ouputPath + "/" + orig.Fullname()
outFile := ouputPath + fmt.Sprintf("/%d/", partitionNum) + fixFilename(orig.Fullname())
if err := os.MkdirAll(path.Dir(outFile), 0777); err != nil {
fmt.Printf("ERR: could not create path %s: %s", path.Dir(outFile), err)
return
Expand Down

0 comments on commit 8d4a670

Please sign in to comment.