Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcl::io::savePCDFileBinary create file without right to read ( -rw-------) #1759

Closed
nikkadim opened this issue Nov 15, 2016 · 1 comment
Closed
Labels
kind: bug Type of issue

Comments

@nikkadim
Copy link

nikkadim commented Nov 15, 2016

Your Environment

  • Operating System and version: Ubuntu 16.04
  • Compiler: gcc version 5.4.0
  • PCL Version: 1.7.2

Expected Behavior

pcl::io::savePCDFileASCII and pcl::io::savePCDFileBinary should generate files with the same user right

Current Behavior

test_pcd.pcd - generated with savePCDFileASCII
test_pcd_.pcd - generated with savePCDFileBinary (see rights for read)

-rw-r--r-- 1 root root 41892 Nov 15 17:13 CMakeCache.txt
drwxr-xr-x 5 root root 4096 Nov 15 17:17 CMakeFiles
-rw-r--r-- 1 root root 1375 Nov 15 17:13 cmake_install.cmake
-rw-r--r-- 1 root root 4889 Nov 15 17:15 Makefile
-rwxr-xr-x 1 root root 274784 Nov 15 17:17 pcd_write
-rw------- 1 root root 4156 Nov 15 17:17 test_pcd_.pcd
-rw-r--r-- 1 root root 337 Nov 15 17:17 test_pcd.pcd
Press any key to continue...

Code to Reproduce

#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>

int
  main (int argc, char** argv)
{
  pcl::PointCloud<pcl::PointXYZ> cloud;

  // Fill in the cloud data
  cloud.width    = 5;
  cloud.height   = 1;
  cloud.is_dense = false;
  cloud.points.resize (cloud.width * cloud.height);

  for (size_t i = 0; i < cloud.points.size (); ++i)
  {
    cloud.points[i].x = 1024 * rand () / (RAND_MAX + 1.0f);
    cloud.points[i].y = 1024 * rand () / (RAND_MAX + 1.0f);
    cloud.points[i].z = 1024 * rand () / (RAND_MAX + 1.0f);
  }

  pcl::io::savePCDFileASCII ("test_pcd.pcd", cloud);
  pcl::io::savePCDFileBinary ("test_pcd_.pcd", cloud);
  std::cerr << "Saved " << cloud.points.size () << " data points to test_pcd.pcd." << std::endl;

  for (size_t i = 0; i < cloud.points.size (); ++i)
    std::cerr << "    " << cloud.points[i].x << " " << cloud.points[i].y << " " << cloud.points[i].z << std::endl;

  return (0);
}

Thank you

@SergioRAgostinho SergioRAgostinho added the kind: bug Type of issue label Dec 11, 2016
@SergioRAgostinho
Copy link
Member

Verified on master on a OS X platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Type of issue
Projects
None yet
Development

No branches or pull requests

2 participants