~vladh/fotografiska2

434e51f0c94fd05b479e7b3662de472c3b2a874b — Vlad-Stefan Harbuz 1 year, 10 months ago 250b5fb
add globbing
1 files changed, 10 insertions(+), 4 deletions(-)

M main.go
M main.go => main.go +10 -4
@@ 3,6 3,7 @@ package main
import (
	"fmt"
	"os"
	"path/filepath"
	"syscall"
	"time"



@@ 70,11 71,16 @@ func getPhotoCreationTime(path string) (time.Time, error) {


func main() {
	path := "/home/vladh/scratch/imgsrc/IMG_1520.jpg"

	t, err := getPhotoCreationTime(path)
	srcdir := "/home/vladh/scratch/imgsrc/*"
	paths, err := filepath.Glob(srcdir)
	if err != nil { panic(err) }

	fmt.Printf("Creation time: %+v\n", t)
	for _, path := range paths {
		fmt.Printf("File: %+v\n", path)
		t, err := getPhotoCreationTime(path)
		if err != nil { panic(err) }

		fmt.Printf("Creation time: %+v\n", t)
	}
}