Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: "Copy", Short: "copy an embedded file to a file system", Long: `returns error status 1 if file not found.`, Run: func(cmd *cobra.Command, args []string) { clogFs := config.CoreFs() srcPath := args[0] dstPath := args[1] src, err := clogFs.Open(core.Clean(srcPath)) if err != nil { fmt.Fprintf(os.Stderr, "%s\n", err) os.Exit(126) } defer src.Close() dst, err := os.Create(dstPath) if err != nil { fmt.Fprintf(os.Stderr, "%s\n", err) os.Exit(126) } defer dst.Close() nBytes, err := io.Copy(dst, src) if err != nil { fmt.Fprintf(os.Stderr, "%s (%d bytes copied)\n", err, nBytes) os.Exit(126) } }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.