Hi. I have server that read/write data to many files (each is about
4-32Mb). To determine on which file i need to read/write i'm use this
function to os.OpenFile

func oid2filepath(cfg *Config, oID uint64) string {
file_path := filepath.Join(cfg.WorkDir, fmt.Sprintf("%x",
oid2vid(oID)), fmt.Sprintf("%016x", oID))
return file_path
}

oid2vid function get uint32 and return uint32 with shift some bits
path looks like (for one of 4Mb chunk) store/obj/7c2b25/007c2b2500000180

When i'm write 4Gb data i need to call this function 1024 times for
single big chunk of data.
Does it possible to write function that does not have additional allocations?
And does it possible to write it in portable way (i mean path separator).


-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to