Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for AddFS (0.15 sec)

  1. src/archive/zip/writer.go

    		w.compressors = make(map[uint16]Compressor)
    	}
    	w.compressors[method] = comp
    }
    
    // AddFS adds the files from fs.FS to the archive.
    // It walks the directory tree starting at the root of the filesystem
    // adding each file to the zip using deflate while maintaining the directory structure.
    func (w *Writer) AddFS(fsys fs.FS) error {
    	return fs.WalkDir(fsys, ".", func(name string, d fs.DirEntry, err error) error {
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Thu Apr 04 14:28:57 GMT 2024
    - 19.3K bytes
    - Viewed (0)
  2. src/archive/tar/writer_test.go

    	fsys := fstest.MapFS{
    		"file.go":              {Data: []byte("hello")},
    		"subfolder/another.go": {Data: []byte("world")},
    	}
    	var buf bytes.Buffer
    	tw := NewWriter(&buf)
    	if err := tw.AddFS(fsys); err != nil {
    		t.Fatal(err)
    	}
    
    	// Test that we can get the files back from the archive
    	tr := NewReader(&buf)
    
    	entries, err := fsys.ReadDir(".")
    	if err != nil {
    		t.Fatal(err)
    Go
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Tue Feb 27 16:39:23 GMT 2024
    - 38.7K bytes
    - Viewed (0)
Back to top