CreateDir zu Tools hinzugefügt.

This commit is contained in:
Marco Kittel 2025-06-22 20:28:38 +02:00
parent 42e0ed4d33
commit d7bc6feff9
1 changed files with 5 additions and 0 deletions

View File

@ -2,11 +2,16 @@ package tools
import ( import (
"errors" "errors"
"io/fs"
"os" "os"
"regexp" "regexp"
"time" "time"
) )
func Createdir(path string, rights fs.FileMode) error {
return os.Mkdir(path, rights)
}
func IsFilenameValid(filename string) bool { func IsFilenameValid(filename string) bool {
pattern := `^20[2-9][0-9]-(0[1-9]|1[0-2])-(0[0-9]|1[0-9]|2[0-9]|3[0-1])T(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]:[0-5][0-9])((\+00:00)|(\-00:00)|(\-0[3,9]:30)|(\-1[0-2]:00)|(-0[0-9]:00)|(\+0[0-9]:00)|(\+0[09,03,04,05,06]:30)|(\+10:30)|(\+1[0-4]:00)|(\+0[5,8]:45)|(\+12:45))-(CH|DE|EU|AT)-(stock|delivery).csv$` pattern := `^20[2-9][0-9]-(0[1-9]|1[0-2])-(0[0-9]|1[0-9]|2[0-9]|3[0-1])T(0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]:[0-5][0-9])((\+00:00)|(\-00:00)|(\-0[3,9]:30)|(\-1[0-2]:00)|(-0[0-9]:00)|(\+0[0-9]:00)|(\+0[09,03,04,05,06]:30)|(\+10:30)|(\+1[0-4]:00)|(\+0[5,8]:45)|(\+12:45))-(CH|DE|EU|AT)-(stock|delivery).csv$`
re := regexp.MustCompile(pattern) re := regexp.MustCompile(pattern)