bug-recutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-recutils] Several questions and comments


From: Jose E. Marchesi
Subject: Re: [bug-recutils] Several questions and comments
Date: Sat, 26 Jan 2019 16:48:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello Brian.

    I've been using recutils, and I really like it! I've found it to be
    quite useful. However, I've read through the documentation, and there's
    several things I either don't know how to do, don't work, or that I
    think would be good to be able to do. I'd like to mention them all here
    and see if anyone has answers or suggestions.

Let's see if I can be of any help... :)

    1) Is there a way to programmatically create and defined a record type?
       recins and recset let you add record entries of a given type, but I
       don't see any commands, arguments, or flags that let you define a new
       record type with fields, constraints, etc.

Currently, no, there isn't a way to do that programmatically.

I always thought it would be the role of "recinf" to _read_ the
properties of a record set... but setting them... no.

I guess it would be nice to have something like that.  After all, record
descriptors are just records? or they aren't? :)

    2) With recset, is it possible to set multiple fields at once?

Yes.  You can specify several fields with -f, like in:

$ recset -f foo,bar -s XXX foo.rec

    3) With recins/recset, I think it'd be great to see the added/updated
       records. Currently, I use recsel to find the record I want to update,
       then use recset to update it, then use recsel again to see the
       updated record to make sure it was updated properly. It'd be nice if
       that third setup wasn't necessary because recset did it
       automatically.

That's a nice idea.  I just wrote it down.  Of course they would only do
that when they are invoked interactively, right?

    4) Is there a way to disallow all types that aren't defined as
       mandatory or allowed for a type? I'd like to restrict a record type
       to only the specifically defined fields. This would be useful in
       preventing typos, like accidentally adding "Noets" instead of
       "Notes" to a record.

That's the purpose of %allowed.  From the user manual:

"If there are more or one '%allowed' fields in a record descriptor, all
 fields of all the records in the record set must be in the union of
 '%allowed', '%mandatory' and '%key'.  Otherwise an integrity error is
 raised."

    5) Is it possible to update text fields by appending to them? I have a
       Notes field that I use, which I will occasionally update by appending
       to it. Currently, I either have to use recsel to get the current
       value, then edit the record with the current value appended by the
       new notes I want to add or I have to manually edit the document.

No, that's not possible.  I guess this could be achieved adding a new
option to recset... -A maybe?  Or more generally, figuring out a way to
refer to the existing contents of the field in -s or -S.  Would you like
to give it a try? :)

    6) Is it possible to define multiple fields for sorting with %sort%?
       For instance, if I want to sort by Brand then Product, instead of
       just Brand.

Nope.  You will have to concatenate several sorts for that.

    7) This is specific to the macOS Homebrew installation of recutils, but
       the info documentation didn't get installed. Does anyone happen to
       know how to fix that or get it installed?

No clue.

    8) Commands that modify a recfile, like recins, recset, and recfix --
       auto, don't seem to work when the recfile is on a network drive. For
       instance, I use pCloud for cloud storage (instead of Dropbox, etc.).
       pCloud works first and foremost by setting up basically a cloud
       network drive on your computer. On macOS, it's at ~/pCloud Drive and
       on Windows its drive P: (which I mount to /mnt/p in the Windows Linux
       Subsystem), by default. Trying to modify recfiles directly in these
       locations fails. For instance, just now on my Mac, trying to edit a
       file with recfix --auto results in:
    recfix: error: renaming file
    /var/folders/2p/2ksrj79s3tj08ztq2q4lh5280000gn/T/recQi0IZr to test.rec
    Seems like it can copy the file to a temporary file, which it then
    modified, then when it tried to copy the modified temp file back to
    replace the original recfile, it can't.

Yes, I am aware of that bug.  Basically, recutils is using the rename(2)
standard function, that does not work across filesystems.  I will fix it
soon in a new release.

    9) Small English grammar note: On the FAQ, page  one of the questions is
       "What is the name of the turtles?" but it should be "What are the
       names of the turtles?" instead.
    https://www.gnu.org/software/recutils/faq.html

I just fixed that right now!
Thanks, and welcome!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]