`cat somefile.nc | ncks --jsn` errors with: `ncks: ERROR received 0 filenames; 
need at least one`

using Nim to call `ncks` works fine this way
    
    
    let fn = "somefile.nc"
    let tenminfile = execProcess("ncks", args = ["--jsn", fn], 
options={poUsePath})
    
    
    Run

this works fine for what I do now, but for a small project I have to downlod 
thousands of files and I'd like to "bypass" the file writing to disk. Do it all 
in memory. So I tried:
    
    
    let fn = "somefile.nc"
    let fin = readFile(fn) #imagine as body(stream?) from httpclient download.
    
    var tenminfile=""
    
    let p = startProcess("ncks", args = ["--jsn"], options={poUsePath})
    inputStream(p).writeData(addr(fin), sizeof(fin))
    for line in p.lines:
        tenminfile &= line
    p.close
    
    
    Run

That results in the same `ERROR received 0 filenames` Mayby try the filehandle? 
Adding:
    
    
    let ih = inputHandle(p)
    echo getFileInfo(ih)
    
    
    Run

(on windows) results in: `Error: unhandled exception: The handle is invalid. 
Additional info: 212 [OSError]`

Is there a way to "fake" a file? Make the dowloaded data look like a file? 
Create some virtual file, that works for Win11 and FreeBSD? (not using a 
RAMdisk)

Reply via email to