Giter VIP home page Giter VIP logo

ds_store's People

Contributors

gehaxelt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ds_store's Issues

Passing filename directly in example code

Your sample tool expects the filename to be passed with -i.

I think this could be made simpler by just accepting a filename, e.g.
ds_storeviewer [path_to]/.DS_Store

Also in case no parameter is given at all you could just try if .DS_Store exists in the current directory with its original filename and parse that.

Furthermore I'd suggest to have the example code as a file itself and not as part of the readme.

Error parsing DS_Store file

Hi, I'm having errors parsing a DS_Store
I'm using your code:

package main

import (
	"fmt"
	"os"
	"flag"
	"github.com/gehaxelt/ds_store"
	"io/ioutil"
)

func main() {

	var fileName string

	flag.StringVar(&fileName, "i", "", "DS_Store input file")
	flag.Parse()

	if fileName == "" {
		panic("FileName (-i): Must be specified")
	} else if _, err := os.Stat(fileName); os.IsNotExist(err) {
		panic("FileName (-i): File does not exist:" + fileName)
	}

	dat, err := ioutil.ReadFile(fileName)

	if err != nil {
		panic(err)
	}

	a, err := ds_store.NewAllocator(dat)

	filenames, err := a.TraverseFromRootNode()
	if err != nil {
		panic(err)
	}

	for _,f := range filenames {
		fmt.Printf("File: %s \n", f)
	}
}

I've compiled it:

go build ds.go

After executing:

[/tmp]> ./ds -i DS_Store
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x10a3b76]

goroutine 1 [running]:
github.com/gehaxelt/ds_store.(*Allocator).TraverseFromRootNode(0x0, 0x1803, 0x1a03, 0x0, 0x10f0f60, 0xc00004e240)
	/Users/jbono/go/src/github.com/gehaxelt/ds_store/ds_store.go:188 +0x26
main.main()
	/tmp/ds.go:32 +0x13a

It's crashing in this function

Attached the DS_Store file as DS_Store.zip since GitHub doesn't allows DS_Store to be uploaded.

DS_Store.zip

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.