It's cross platform in go.
On Feb 13, 2014 10:55 PM, "jaked122" <notifications@github.com> wrote:

> In src/disk/filesystem.go:
>
> > +	if err!=nil&&!os.IsExist(err){
> > +		return nil,err
> > +	}
> > +	return &i,nil
> > +}
> > +
> > +func (r SwarmStorage) CreateFile(filehash string, length uint64) error{
> > +	file,err:=os.Create(r.SwarmId+string(os.PathSeparator)+filehash)
> > +	defer file.Close()
> > +	if os.IsExist(err){
> > +
> > +	}
> > +	if err==nil{
> > +		b:=[]byte{0}
> > +		for i :=uint64(0);i<length;i++{
> > +			_,_=file.Write(b)
>
> Found it. os.Truncate
> Sets a file to a specific length. Replaced the null-insertion code to do
> that instead.
> Should be portable, maybe.
> The python implementation isn't, but there is no note specifying
> otherwisein the Golang documentation. We'll have to see.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/Siacoin/Sia/pull/4/files#r9738695>
> .
>