9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] Vcard filesystem
@ 2024-11-08 16:04 sirjofri
  2024-11-13  4:29 ` Noam Preil
  2024-11-14  9:27 ` Shawn Rutledge
  0 siblings, 2 replies; 4+ messages in thread
From: sirjofri @ 2024-11-08 16:04 UTC (permalink / raw)
  To: 9fans

Hello everyone,

some time ago I started working on a filesystem for vcard files. The filesystem manages a vcard database (stored in the user lib dir), and mounts itself to /mnt/vcard per default.

I'm at a point where I consider it ready for anyone to use. There might be bugs, memory leaks, and other things that could be improved, but it is something that could be used as a backend system for other tools, or just used directly.

https://shithub.us/sirjofri/vcardfs
https://git.sr.ht/~sirjofri/vcardfs

(Technical details following, feel free to stop reading here).

It comes with a library (libvcard) for parsing vcard files, and supports version 2.1 and 3.0/4.0, though it doesn't validate the vcard data (it only reads the syntax and loads the data, with the only exception being the version property, but that gets too technical).

The filesystem supports importing new vcard data, and also exporting the whole database as vcard, as well as exporting individual cards. For exporting, it only supports vcard version 4.0 (hardcoded).

It is however important to note that I'm not very experienced at writing filesystems and properly synchronized code, so there could be issues when multiple programs access the data.

Patches are welcome.

sirjofri

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T4d117dbbd00ae4f7-Mdce2a45adb63efe5df4cb3b9
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Vcard filesystem
  2024-11-08 16:04 [9fans] Vcard filesystem sirjofri
@ 2024-11-13  4:29 ` Noam Preil
  2024-11-14  9:27 ` Shawn Rutledge
  1 sibling, 0 replies; 4+ messages in thread
From: Noam Preil @ 2024-11-13  4:29 UTC (permalink / raw)
  To: 9fans

Definitely interested, I'll take a look :)

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T4d117dbbd00ae4f7-Med7db4d9926636051febfce4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Vcard filesystem
  2024-11-08 16:04 [9fans] Vcard filesystem sirjofri
  2024-11-13  4:29 ` Noam Preil
@ 2024-11-14  9:27 ` Shawn Rutledge
  2024-11-14 22:13   ` Frank D. Engel, Jr.
  1 sibling, 1 reply; 4+ messages in thread
From: Shawn Rutledge @ 2024-11-14  9:27 UTC (permalink / raw)
  To: 9fans

> On Nov 8, 2024, at 17:04, sirjofri <sirjofri+ml-9fans@sirjofri.de> wrote:
> 
> Hello everyone,
> 
> some time ago I started working on a filesystem for vcard files. The filesystem manages a vcard database (stored in the user lib dir), and mounts itself to /mnt/vcard per default.

I don’t think I like the idea of one big vcf file for all contacts.  I’d prefer to use a directory with a file for each contact, where the file name is the person’s name.  That way it’s already easy to use cat and grep on the raw files, and easy to use tools like syncthing to keep the whole database in sync between devices (there’s much less chance of sync conflicts if it’s broken up, and the file timestamp always indicates the last-updated time for a single record.  Yeah, we don’t have syncthing, but I assume you have some way to sync files for offline use.)  The file server should just make each vcard file appear as a directory, and each property becomes a file inside, as you have it already.  It should help with multi-process writing too, only writing to one record at a time in each process.

But it’s good that you have a working parser for the most recent version.


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T4d117dbbd00ae4f7-M68e41c1368ca65891193463f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] Vcard filesystem
  2024-11-14  9:27 ` Shawn Rutledge
@ 2024-11-14 22:13   ` Frank D. Engel, Jr.
  0 siblings, 0 replies; 4+ messages in thread
From: Frank D. Engel, Jr. @ 2024-11-14 22:13 UTC (permalink / raw)
  To: 9fans

That strategy worked particularly well on BeOS, which had database-like 
indexed extended attributes in its native filesystem.

Individual "People" files basically stored all of the individual fields 
(phone number, etc.) as extended attributes of the files and they were 
indexed by the filesystem and rapidly searchable.

Not vcards, but native to the OS and nicely designed for it.


On 11/14/24 04:27, Shawn Rutledge wrote:
>> On Nov 8, 2024, at 17:04, sirjofri <sirjofri+ml-9fans@sirjofri.de> wrote:
>>
>> Hello everyone,
>>
>> some time ago I started working on a filesystem for vcard files. The filesystem manages a vcard database (stored in the user lib dir), and mounts itself to /mnt/vcard per default.
> I don’t think I like the idea of one big vcf file for all contacts.  I’d prefer to use a directory with a file for each contact, where the file name is the person’s name.  That way it’s already easy to use cat and grep on the raw files, and easy to use tools like syncthing to keep the whole database in sync between devices (there’s much less chance of sync conflicts if it’s broken up, and the file timestamp always indicates the last-updated time for a single record.  Yeah, we don’t have syncthing, but I assume you have some way to sync files for offline use.)  The file server should just make each vcard file appear as a directory, and each property becomes a file inside, as you have it already.  It should help with multi-process writing too, only writing to one record at a time in each process.
> 
> But it’s good that you have a working parser for the most recent version.
> 

------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/T4d117dbbd00ae4f7-M6e941d896025d86963c0827f
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-14 22:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-08 16:04 [9fans] Vcard filesystem sirjofri
2024-11-13  4:29 ` Noam Preil
2024-11-14  9:27 ` Shawn Rutledge
2024-11-14 22:13   ` Frank D. Engel, Jr.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).