<commit_before>// Random odds and ends.

package fuse

import (
	"os"
	"fmt"
	"log"
	"math"
	"reflect"
	"regexp"
	"syscall"
	"unsafe"
	"io/ioutil"
)


func (code Status) String() string {
	if code == OK {
		return "OK"
	}
	return fmt.Sprintf("%d=%v", int(code), os.Errno(code))
}

// Make a temporary directory securely.
func MakeTempDir() string {
	nm, err := ioutil.TempDir("", "go-fuse")
	if err != nil {
		panic("TempDir() failed: " + err.String())
	}
	return nm
}

// Convert os.Error back to Errno based errors.
func OsErrorToErrno(err os.Error) Status {
	if err != nil {
		switch t := err.(type) {
		case os.Errno:
			return Status(t)
		case *os.SyscallError:
			return Status(t.Errno)
		case *os.PathError:
			return OsErrorToErrno(t.Error)
		case *os.LinkError:
			return OsErrorToErrno(t.Error)
		default:
			log.Println("can't convert error type:", err)<commit_msg>Introduce Status.Ok().<commit_after>// Random odds and ends.

package fuse

import (
	"os"
	"fmt"
	"log"
	"math"
	"reflect"
	"regexp"
	"syscall"
	"unsafe"
	"io/ioutil"
)


func (code Status) String() string {
	if code == OK {
		return "OK"
	}
	return fmt.Sprintf("%d=%v", int(code), os.Errno(code))
}

func (code Status) Ok() bool {
	return code == OK
}

// Make a temporary directory securely.
func MakeTempDir() string {
	nm, err := ioutil.TempDir("", "go-fuse")
	if err != nil {
		panic("TempDir() failed: " + err.String())
	}
	return nm
}

// Convert os.Error back to Errno based errors.
func OsErrorToErrno(err os.Error) Status {
	if err != nil {
		switch t := err.(type) {
		case os.Errno:
			return Status(t)
		case *os.SyscallError:
			return Status(t.Errno)
		case *os.PathError:
			return OsErrorToErrno(t.Error)
		case *os.LinkError:
			return OsErrorToErrno(t.Error)
		default:
			log.Println("can't convert error type:", err)
{'fraction_non_alphanumeric': 0.1565600882028666, 'fraction_numerical': 0.0, 'mean_word_length': 3.5488721804511276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2674829', 'n_tokens_mistral': 754, 'n_tokens_neox': 684, 'n_words': 188}