[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #MEJ-623272]: NC_DISKLESS file permissions question
- Subject: [netCDF #MEJ-623272]: NC_DISKLESS file permissions question
- Date: Wed, 27 Jun 2012 13:43:54 -0600
> I am using rc1, not a snapshot, so far as I know:
>
> zender@roulee:~/nco$ ncks --lib
> Linked to netCDF library version 4.2.1-rc1, compiled Jun 21 2012 22:52:46
>
> zender@roulee:~/nco$ nc-config --version
> netCDF 4.2.1-rc1
>
> Puzzling. What is your UMASK value?
It's 0002, but I think I see the problem. In my testing, I was writing to
a file that already existed, named "tmp.nc" that had 644 permissions, so
nccopy wasn't changing the permissions, although it was overwriting the
file. Apparently the bug is still there for creating a new file, it looks
like it ignores the umask value in that case:
$ umask
0002
$ nccopy test1.nc tmp.nc && ls -l tmp.nc
-rw-rw-r-- 1 russ ustaff 108 Jun 27 13:41 tmp.nc
$ nccopy -w test0.nc tmp.nc && ls -l tmp.nc
-rw-rw-r-- 1 russ ustaff 104 Jun 27 13:41 tmp.nc
$ rm tmp.nc
$ nccopy -w test0.nc tmp.nc && ls -l tmp.nc
-rwxrwxr-x 1 russ ustaff 104 Jun 27 13:42 tmp.nc
Thanks for reporting this! We'll try to fix it for real, this time ...
--Russ
> On 06/27/2012 11:47 AM, Unidata netCDF Support wrote:
> > Charlie,
> >
> > I should have also pointed out that the fix takes UMASK into account,
> > rather than just setting the output file permissions to 644 ...
> >
> > --Russ
> >
> >>> What sets/controls the permissions on files nc_create()'d
> >>> with NC_DISKLESS? NCO normally creates files with UNIX
> >>> permissions 644 (octal), but those created with NC_DISKLESS have
> >>> mode 755. Wondering what the recommended way is to ensure
> >>> files are created with 644 permissions. I can invoke
> >>> chmod() from within NCO if necessary, though this seems
> >>> rather baroque.
> >>>
> >>> nccopy exhibits this behavior too, as shown here:
> >>>
> >>> zender@roulee:~$ nccopy -r -w ~/nco/data/in.nc ~/foo.nc
> >>> zender@roulee:~$ ls -l foo.nc
> >>> -rwxr-xr-x 1 zender zender 42356 Jun 26 23:36 foo.nc
> >>> zender@roulee:~$ nccopy -r ~/nco/data/in.nc ~/foo.nc
> >>> zender@roulee:~$ ls -l foo.nc
> >>> -rw-r--r-- 1 zender zender 42356 Jun 26 23:37 foo.nc
> >>
> >> This problem is fixed in netcdf-4.2.1-rc1, announced last week. Are
> >> you testing on a snapshot release from before that announcement? I
> >> just tried it with 4.2.1-rc1 in nccopy, and the files it creates have
> >> 644 permissions.
> >>
> >> Incidentally, I haven't found an example in using nccopy where the
> >> "-r" option for copying the input file into a diskless file first
> >> provides a performance improvement.
> >>
> >> --Russ
> >>
> >> Russ Rew UCAR Unidata Program
> >> address@hidden http://www.unidata.ucar.edu
> >>
> >>
> >
> > Russ Rew UCAR Unidata Program
> > address@hidden http://www.unidata.ucar.edu
> >
> >
> >
> > Ticket Details
> > ===================
> > Ticket ID: MEJ-623272
> > Department: Support netCDF
> > Priority: Normal
> > Status: Closed
> >
> >
>
>
> --
> Charlie Zender, Department of Earth System Science
> University of California, Irvine 949-891-2429 )'(
>
>
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: MEJ-623272
Department: Support netCDF
Priority: Normal
Status: Closed