-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Closed
Description
The following program hangs:
using System.ComponentModel;
using System.IO.Compression;
using System.Runtime.InteropServices;
var dir = Directory.CreateDirectory(Path.Combine(Path.GetTempPath(), Path.GetRandomFileName())).FullName;
int res = MkFifo(Path.Combine(dir, "fifo"), 0x1ff);
if (res != 0)
{
throw new Win32Exception();
}
ZipFile.CreateFromDirectory(dir, Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()));
[DllImport("libSystem.Native", EntryPoint = "SystemNative_MkFifo", SetLastError = true)]
static extern int MkFifo(string pathName, uint mode);ZipFile handles the fifo as a regular file. The open call doesn't return (because there is no peer that has it opened for writing, and the fifo isn't opened as non-blocking).
Instead of trying to open the fifo, we should either skip it, or throw an exception for encountering an unsupported file type.
Reactions are currently unavailable