Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 414 for readFiles (1.07 sec)

  1. src/io/fs/readfile.go

    package fs
    
    import "io"
    
    // ReadFileFS is the interface implemented by a file system
    // that provides an optimized implementation of [ReadFile].
    type ReadFileFS interface {
    	FS
    
    	// ReadFile reads the named file and returns its contents.
    	// A successful call returns a nil error, not io.EOF.
    	// (Because ReadFile reads the whole file, the expected EOF
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 11 20:25:50 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  2. src/text/template/helper.go

    		}
    		filenames = append(filenames, list...)
    	}
    	return parseFiles(t, readFileFS(fsys), filenames...)
    }
    
    func readFileOS(file string) (name string, b []byte, err error) {
    	name = filepath.Base(file)
    	b, err = os.ReadFile(file)
    	return
    }
    
    func readFileFS(fsys fs.FS) func(string) (string, []byte, error) {
    	return func(file string) (name string, b []byte, err error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 21:54:08 UTC 2024
    - 6.4K bytes
    - Viewed (0)
  3. src/io/fs/readfile_test.go

    var sysValue int
    
    type readFileOnly struct{ ReadFileFS }
    
    func (readFileOnly) Open(name string) (File, error) { return nil, ErrNotExist }
    
    type openOnly struct{ FS }
    
    func TestReadFile(t *testing.T) {
    	// Test that ReadFile uses the method when present.
    	data, err := ReadFile(readFileOnly{testFsys}, "hello.txt")
    	if string(data) != "hello, world" || err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 16:25:41 UTC 2023
    - 1.8K bytes
    - Viewed (0)
  4. platforms/core-runtime/logging/src/integTest/groovy/org/gradle/internal/logging/console/taskgrouping/AbstractLoggingHooksFunctionalTest.groovy

                    println "finished"
                    assert output.toString().readLines() == [":log", "output"]
                    assert error.toString().readLines() == ["error"]
                    assert before.toString().readLines() == [":log", "output", "error"]
                    assert after.toString().readLines() == []
                }
            """
    
            expect:
            succeeds("log", "other")
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:05:18 UTC 2023
    - 9.3K bytes
    - Viewed (0)
  5. platforms/native/platform-native/src/testFixtures/groovy/org/gradle/nativeplatform/fixtures/binaryinfo/OtoolBinaryInfo.groovy

            def process = ['ar', '-t', binaryFile.getAbsolutePath()].execute(environments, null)
            return process.inputStream.readLines().drop(1)
        }
    
        List<String> listLinkedLibraries() {
            def process = ['otool', '-L', binaryFile.absolutePath].execute(environments, null)
            def lines = process.inputStream.readLines()
            return lines
        }
    
        List<Symbol> listSymbols() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Nov 16 20:20:03 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  6. src/io/ioutil/ioutil_test.go

    	}
    }
    
    func TestReadFile(t *testing.T) {
    	filename := "rumpelstilzchen"
    	contents, err := ReadFile(filename)
    	if err == nil {
    		t.Fatalf("ReadFile %s: error expected, none found", filename)
    	}
    
    	filename = "ioutil_test.go"
    	contents, err = ReadFile(filename)
    	if err != nil {
    		t.Fatalf("ReadFile %s: %v", filename, err)
    	}
    
    	checkSize(t, filename, int64(len(contents)))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 11 20:56:32 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  7. src/os/read_test.go

    	}
    }
    
    func TestReadFile(t *testing.T) {
    	t.Parallel()
    
    	filename := "rumpelstilzchen"
    	contents, err := ReadFile(filename)
    	if err == nil {
    		t.Fatalf("ReadFile %s: error expected, none found", filename)
    	}
    
    	filename = "read_test.go"
    	contents, err = ReadFile(filename)
    	if err != nil {
    		t.Fatalf("ReadFile %s: %v", filename, err)
    	}
    
    	checkNamedSize(t, filename, int64(len(contents)))
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 02:36:46 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  8. src/cmd/internal/buildid/buildid_test.go

    			continue
    		}
    		defer os.Remove(f)
    		id, err := ReadFile(f)
    		if id != expectedID || err != nil {
    			t.Errorf("ReadFile(testdata/%s) = %q, %v, want %q, nil", f, id, err, expectedID)
    		}
    		old := readSize
    		readSize = 2048
    		id, err = ReadFile(f)
    		readSize = old
    		if id != expectedID || err != nil {
    			t.Errorf("ReadFile(%s) [readSize=2k] = %q, %v, want %q, nil", f, id, err, expectedID)
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 04 17:31:28 UTC 2024
    - 6.6K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go

    			}
    		}
    		return true
    	})
    	return !safe
    }
    
    // ReadFile reads a file and adds it to the FileSet
    // so that we can report errors against it using lineStart.
    func ReadFile(pass *analysis.Pass, filename string) ([]byte, *token.File, error) {
    	readFile := pass.ReadFile
    	if readFile == nil {
    		readFile = os.ReadFile
    	}
    	content, err := readFile(filename)
    	if err != nil {
    		return nil, nil, err
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  10. pkg/util/kernel/version.go

    func GetVersion() (*version.Version, error) {
    	return getVersion(os.ReadFile)
    }
    
    // getVersion reads os release file from the give readFile function.
    func getVersion(readFile readFileFunc) (*version.Version, error) {
    	kernelVersionFile := "/proc/sys/kernel/osrelease"
    	fileContent, err := readFile(kernelVersionFile)
    	if err != nil {
    		return nil, fmt.Errorf("failed to read os-release file: %s", err.Error())
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Oct 27 19:24:34 UTC 2023
    - 1.4K bytes
    - Viewed (0)
Back to top