Last active
September 4, 2023 12:37
-
-
Save ranskills/84b888af24cfea74c1818ffa3a1e4ff4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "regexp" | |
var r, _ = regexp.Compile("\\\\|/|:|\\*|\\?|<|>") | |
// MakeFilenameWindowsFriendly removes characters not permitted in file/directory names on Windows | |
func MakeFilenameWindowsFriendly(name string) string { | |
return r.ReplaceAllString(name, "") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@curiosport Good observation.
I was not targeting a full-proof implementation because I had some files from a Windows machine I was processing and this sufficed, but I may update this based on the resources you shared.
Thanks!