(ctx *sql.Context, subdir string)
| 10 | ) |
| 11 | |
| 12 | func (h *DuckBuilder) CreatePipe(ctx *sql.Context, subdir string) (string, error) { |
| 13 | // Create the FIFO pipe |
| 14 | pipeDir := filepath.Join(h.provider.DataDir(), "pipes", subdir) |
| 15 | if err := os.MkdirAll(pipeDir, 0755); err != nil { |
| 16 | return "", err |
| 17 | } |
| 18 | pipeName := strconv.Itoa(int(ctx.ID())) + ".pipe" |
| 19 | pipePath := filepath.Join(pipeDir, pipeName) |
| 20 | ctx.GetLogger().Debugln("Creating FIFO pipe for LOAD/COPY operation:", pipePath) |
| 21 | if err := syscall.Mkfifo(pipePath, 0600); err != nil { |
| 22 | return "", err |
| 23 | } |
| 24 | return pipePath, nil |
| 25 | } |
| 26 | |
| 27 | func RemoveAllPipes(dataDir string) error { |
| 28 | pipesDir := filepath.Join(dataDir, "pipes") |
no test coverage detected