summaryrefslogtreecommitdiff
path: root/src/pkg/io
AgeCommit message (Collapse)AuthorFilesLines
2011-04-28Imported Upstream version 2011.04.27upstream/2011.04.27Ondřej Surý2-3/+12
2011-04-26Imported Upstream version 2011.04.13upstream/2011.04.13Ondřej Surý6-250/+166
2011-04-20Imported Upstream version 2011.03.07.1upstream/2011.03.07.1Ondřej Surý2-4/+56
2011-02-18Imported Upstream version 2011.02.15upstream/2011.02.15Ondřej Surý1-2/+11
2011-01-17Imported Upstream version 2011.01.12upstream/2011.01.12Ondřej Surý11-31/+278
2010-06-30io/ioutil.TempFile for WindowsPeter Mundy2-12/+13
Fixes issue 834. R=rsc, brainman CC=golang-dev http://codereview.appspot.com/1686047 Committer: Russ Cox <rsc@golang.org>
2010-06-30io: Avoid race condition in pipe.Ian Lance Taylor1-1/+2
One goroutine started up and was waiting in rw. Then another goroutine decided to close the pipe. The closing goroutine stalled calling p.io.Lock() in pipeHalf.close. (This happened in gccgo). If the closing goroutine had been able to set the ioclosed flag, it would have gone on to tell the runner that the pipe was closed, which would then send an EINVAL to the goroutine sleeping in rw. Unlocking p.io before sleeping in rw avoids the race. R=rsc, rsc1 CC=golang-dev http://codereview.appspot.com/1682048
2010-06-03io/ioutil: add TempFileRuss Cox3-0/+93
R=r CC=golang-dev http://codereview.appspot.com/1472042
2010-04-27pipe: implementation #3; this time for sure!Russ Cox2-118/+220
Added goroutine; got simpler. Fixes deadlock when doing Read+Close or Write+Close on same end. R=r, cw CC=golang-dev http://codereview.appspot.com/994043
2010-04-22FileInfo: regularize the types of some fields.Rob Pike2-3/+3
Uid, Gid become int. File size info becomes int64. Times become int64. R=rsc, cw CC=golang-dev http://codereview.appspot.com/968042
2010-04-09rename os.Dir to os.FileInfoRob Pike1-13/+13
R=rsc CC=golang-dev http://codereview.appspot.com/902042
2010-04-05io/ioutil: fix bug in ReadFile when Open succeeds but Stat failsRuss Cox1-1/+1
R=gri CC=golang-dev http://codereview.appspot.com/867044
2010-02-25strings: delete Runes, BytesRuss Cox3-9/+4
gofmt -w -r 'strings.Bytes(a) -> []byte(a)' src/cmd src/pkg test/bench gofmt -w -r 'strings.Runes(a) -> []int(a)' src/cmd src/pkg test/bench delete unused imports R=r CC=golang-dev http://codereview.appspot.com/224062
2010-02-01io: revised Pipe implementationRuss Cox1-61/+41
* renamed channels to say what gets sent * use channel closed status instead of racy check of boolean R=nigeltao_golang CC=golang-dev http://codereview.appspot.com/196065
2010-01-28io: fix nil Write bug in PipeRuss Cox2-1/+23
R=nigeltao_golang CC=golang-dev http://codereview.appspot.com/194132
2010-01-07add a standard interface that wraps ReadByte, io.ReadByterRob Pike1-0/+8
R=rsc CC=golang-dev http://codereview.appspot.com/181163
2009-12-151) Change default gofmt default settings forRobert Griesemer6-275/+275
parsing and printing to new syntax. Use -oldparser to parse the old syntax, use -oldprinter to print the old syntax. 2) Change default gofmt formatting settings to use tabs for indentation only and to use spaces for alignment. This will make the code alignment insensitive to an editor's tabwidth. Use -spaces=false to use tabs for alignment. 3) Manually changed src/exp/parser/parser_test.go so that it doesn't try to parse the parser's source files using the old syntax (they have new syntax now). 4) gofmt -w src misc test/bench 3rd set of files. R=rsc CC=golang-dev http://codereview.appspot.com/180048
2009-12-09remove uses of string concatenation from src and misc directoryRobert Griesemer1-2/+2
R=rsc http://codereview.appspot.com/172041
2009-12-03Add ReadFrom and WriteTo methods to bytes.Buffer, to enable i/o without ↵Rob Pike3-5/+117
buffer allocation. Use them in Copy and Copyn. Speed up ReadFile by using ReadFrom and avoiding Copy altogether (a minor win). R=rsc, gri CC=golang-dev http://codereview.appspot.com/166041
2009-12-02move ReadFile, WriteFile, and ReadDir into a separate io/ioutil package.Rob Pike5-12/+22
this breaks the dependency of package io on package bytes. R=rsc CC=golang-dev http://codereview.appspot.com/163085
2009-12-01make io.ReadFile use Stat.Size as a hint for preallocationRob Pike1-1/+17
R=rsc CC=golang-dev http://codereview.appspot.com/163069
2009-11-23go: makes it build for the case $GOROOT has whitespacesSergio Luis O. B. Correia1-2/+2
the bash scripts and makefiles for building go didn't take into account the fact $GOROOT / $GOBIN could both be directories containing whitespaces, and was not possible to build it in such a situation. this commit adjusts the various makefiles/scripts to make it aware of that possibility, and now it builds successfully when using a path with whitespaces as well. Fixes issue 115. R=rsc, dsymonds1 http://codereview.appspot.com/157067 Committer: Russ Cox <rsc@golang.org>
2009-11-23io.ReadWriter: fix doc comment (ReadWrite -> ReadWriter)Russ Cox1-1/+1
R=r CC=eds http://codereview.appspot.com/160045
2009-11-20gofmt -r 'α[β:len(α)] -> α[β:]' -w src/cmd src/pkgRuss Cox2-2/+2
R=r, gri CC=golang-dev http://codereview.appspot.com/156115
2009-11-09- replaced gofmt expression formatting algorithm withRobert Griesemer3-6/+6
rsc's algorithm - applied gofmt -w misc src - partial CL (last chunk) R=rsc, r http://go/go-review/1024041
2009-11-09remove semis after statements in one-statement statement listsRobert Griesemer5-85/+85
R=rsc, r http://go/go-review/1025029
2009-11-06- fine-tuning of one-line func heuristic (nodes.go)Robert Griesemer3-21/+7
- enabled for function declarations (not just function literals) - applied gofmt -w $GOROOT/src (look for instance at src/pkg/debug/elf/elf.go) R=r, rsc CC=go-dev http://go/go-review/1026006
2009-11-05gofmt-ify io, json, runtime, encodingRobert Griesemer3-13/+19
R=rsc http://go/go-review/1017056
2009-11-01reverse the arguments to io.Copy so the destination is on theRob Pike2-3/+3
left, like an assignment, like strcpy, etc. R=rsc CC=go-dev http://go/go-review/1016011
2009-10-15- implemented utility functions for directory reading/traversalRobert Griesemer2-1/+61
- added tests R=rsc DELTA=62 (61 added, 1 deleted, 0 changed) OCL=35788 CL=35802
2009-10-08more lgtm files from gofmtRuss Cox1-1/+1
R=gri OCL=35485 CL=35488
2009-10-06apply gofmt to go, gob, hash, http, image, io, json, logRuss Cox4-69/+66
R=gri DELTA=1359 (138 added, 32 deleted, 1189 changed) OCL=35408 CL=35420
2009-09-17unused importsRuss Cox1-1/+0
R=r OCL=34731 CL=34731
2009-09-16rename bytes.Buffer.Data() to bytes.Buffer.Bytes()Rob Pike1-1/+1
R=rsc DELTA=152 (6 added, 0 deleted, 146 changed) OCL=34695 CL=34701
2009-09-15more "declared and not used".Russ Cox1-1/+1
the last round omitted := range and only checked 1 out of N vars in a multi-var := R=r OCL=34624 CL=34638
2009-09-01import debug/gosym from usr/austin/symRuss Cox1-0/+4
R=austin DELTA=958 (956 added, 0 deleted, 2 changed) OCL=34180 CL=34212
2009-08-31add SectionReader, ReaderAt.Russ Cox1-0/+85
R=r DELTA=85 (85 added, 0 deleted, 0 changed) OCL=34141 CL=34144
2009-08-26add io.LimitReader.Russ Cox1-20/+16
use it to limit data read from http.Request Body R=r DELTA=32 (8 added, 6 deleted, 18 changed) OCL=33899 CL=33916
2009-08-18Add a standard Seeker interface.Austin Clements1-0/+30
R=rsc APPROVED=rsc DELTA=35 (30 added, 4 deleted, 1 changed) OCL=33491 CL=33498
2009-08-12convert low-level (used by testing) packages toRuss Cox5-71/+17
whole-package compilation. new Makefiles, tests now in separate package bytes flag fmt io math once os reflect strconv sync time utf8 delete import "xxx" in package xxx. inside package xxx, xxx is not declared anymore so s/xxx.//g delete file and package level forward declarations. note the new internal_test.go and sync and strconv to provide public access to internals during testing. the installed version of the package omits that file and thus does not open the internals to all clients. R=r OCL=33065 CL=33097
2009-07-08comment changeRobert Griesemer1-2/+2
R=r OCL=31359 CL=31359
2009-07-08WriteFile util functionRobert Griesemer2-0/+41
R=rsc DELTA=41 (41 added, 0 deleted, 0 changed) OCL=31349 CL=31358
2009-07-01clean up some BUG/TODO in go codeRuss Cox1-3/+1
R=r DELTA=23 (1 added, 12 deleted, 10 changed) OCL=30957 CL=30980
2009-06-29delete io.ByteBufferRuss Cox1-2/+1
R=r DELTA=25 (0 added, 15 deleted, 10 changed) OCL=30892 CL=30892
2009-06-29io.StringBytes -> strings.BytesRuss Cox6-320/+11
io.ByteBuffer -> bytes.Buffer left io.ByteBuffer stub around for now, for protocol compiler. R=r OCL=30861 CL=30872
2009-06-25Change os.Error convention:Russ Cox1-1/+1
echo back context of call in error if likely to be useful. For example, if os.Open("/etc/passwd", os.O_RDONLY) fails with syscall.EPERM, it returns as the os.Error &PathError{ Op: "open", Path: "/etc/passwd" Error: os.EPERM } which formats as open /etc/passwd: permission denied Not converted: datafmt go/... google/... regexp tabwriter template R=r DELTA=1153 (561 added, 156 deleted, 436 changed) OCL=30738 CL=30781
2009-06-23fix io.Bytebuffer.Read for new EOF semanticsRob Pike1-2/+7
R=rsc DELTA=7 (5 added, 0 deleted, 2 changed) OCL=30657 CL=30659
2009-06-22document requirements on Write methodRuss Cox1-1/+7
R=r DELTA=7 (6 added, 0 deleted, 1 changed) OCL=30596 CL=30605
2009-06-22changes required if we disallow the implicit *Russ Cox1-2/+2
in cap, len, [], and range on maps, strings, and slices. R=r DELTA=57 (2 added, 12 deleted, 43 changed) OCL=30549 CL=30590
2009-06-22introduce os.EOF and io.ErrUnexpectedEOF.Russ Cox4-55/+59
remove io.ErrEOF. rename io.FullRead to io.ReadFull, to match ReadAtLeast and ReadAll. remove io.FullReader, because it is now unused. R=r DELTA=295 (88 added, 105 deleted, 102 changed) OCL=30544 CL=30588