PDAL / PDAL

PDAL is Point Data Abstraction Library. GDAL for point cloud data.
https://pdal.io
Other
1.13k stars 447 forks source link

No error when trying to overwrite a file being used by another program #2609

Closed CUBICinfinity closed 4 years ago

CUBICinfinity commented 5 years ago

I can run pdal pipeline class_color_to_ply.json while the file I'm writing to is open in a text editor. PDAL won't complain but secretly it won't update the ply file. This is my json file:

{
  "pipeline":[
    {
      "type":"readers.las",
      "extra_dims":"red=uint16,green=uint16,blue=uint16",
      "filename":"wall_color.las"
    },
    {
      "type":"writers.ply",
      "filename":"wall_color.ply"
    }
  ]
}
abellgithub commented 5 years ago

I can't recreate this on OSX. What is your OS/PDAL version? It would also be good to be specific about what you did and the result.

CUBICinfinity commented 5 years ago

I'm using Windows 10. I'm running the command in Anaconda Prompt and I have PDAL 1.9.1. I had the ply file open in EmEditor. Running the script like this without the ply file being rewritten took a moment, but much less time than it takes to overwrite.

I just tested overwriting a txt file while using EmEditor. This is what normally happens: image I need to see if I can recreate this problem.

CUBICinfinity commented 5 years ago

Ok, I reproduced the problem using smaller files. As soon as I close EmEditor and try to run the pipeline again it correctly overwrites the ply file. BUT I just tried it with notepad++ and it simply overwrote the ply file and notepad++ asked if I wanted to reload it. So this is just an issue with me using EmEditor and PDAL. I don't think it's worth worrying about.

I'm sorry to waste your time on this. I should troubleshoot things on my own more.

abellgithub commented 5 years ago

PDAL wasn't checking a file creation failure in the PLY writer, but I'm not sure this explains the behavior. I'll test when I have a chance with Windows.