dvalters / fuse-netcdf

ESoWC project to develop a Python utility to mount NetCDF files as a file-system in user space. (FUSE)
Other
8 stars 3 forks source link

Editing variables/attributes support #17

Closed dvalters closed 6 years ago

dvalters commented 6 years ago

This is not yet supported/working:

Current attempts on the branch, but the write()/create() operations do not seem to be triggered? Possibly wrong return values from getattr()?

e.g. touch newattr should create a new variable attribute when in a variable directory similarly touch newvar for new variables, or with an editor to add content.

Branch that I'm working on is here: https://github.com/dvalters/fuse-netcdf/tree/Write-edit-mode

Development notes

The current error is an error from touch about setting times: e.g. touch foobar in a variable directory gives:

touch: setting times of `foobar`: Bad address

Which is an error returned from touch, here in the source code:

https://gist.github.com/JoshCheek/1224782#file-touch-c-L187

  if (!ok)
    {
      if (open_errno)
        {
          /* The wording of this diagnostic should cover at least two cases:
             - the file does not exist, but the parent directory is unwritable
             - the file exists, but it isn't writable
             I think it's not worth trying to distinguish them.  */
          error (0, open_errno, _("cannot touch %s"), quote (file));
        }
      else
        {
          if (no_create && errno == ENOENT)
            return true;
          error (0, errno, _("setting times of %s"), quote (file));
        }
      return false;
    }

The debugging print statements would seem to indicate that we don't even get to create or open methods...

dvalters commented 6 years ago

Made some more progress on the branch now - create() is being called now - just need to give it the correct return values/inputs

dvalters commented 6 years ago

@blazk has taken this much further in the PR #21 (which is now merged into master) so closing this now!