Windows: Use sequential file access

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2016-11-01 15:44:06 -07:00
parent dc2eeb6456
commit 5723c85b1d
1 changed files with 4 additions and 2 deletions

View File

@ -3,13 +3,13 @@ package image
import ( import (
"fmt" "fmt"
"io" "io"
"os"
"golang.org/x/net/context" "golang.org/x/net/context"
"github.com/docker/docker/cli" "github.com/docker/docker/cli"
"github.com/docker/docker/cli/command" "github.com/docker/docker/cli/command"
"github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/system"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
@ -43,7 +43,9 @@ func runLoad(dockerCli *command.DockerCli, opts loadOptions) error {
var input io.Reader = dockerCli.In() var input io.Reader = dockerCli.In()
if opts.input != "" { if opts.input != "" {
file, err := os.Open(opts.input) // We use system.OpenSequential to use sequential file access on Windows, avoiding
// depleting the standby list un-necessarily. On Linux, this equates to a regular os.Open.
file, err := system.OpenSequential(opts.input)
if err != nil { if err != nil {
return err return err
} }