incubator-lucy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marvin Humphrey (JIRA)" <>
Subject [jira] Updated: (LUCY-85) FSFolder
Date Mon, 07 Dec 2009 02:34:28 GMT


Marvin Humphrey updated LUCY-85:

    Attachment: fsfolder_support.diff

This patch also changes the semantics of Folder_Rename() to reflect
portability concerns.  The C standard leaves the behavior of rename()
undefined when something already exists at the target path; on Windows, the
operation fails, while on unixen, the operation clobbers if the target is of
like type.

We may actually be able to do away with Rename() entirely, since writing to a
temp file and then using Folder_Hard_Link() to move the file into place
atomically suffices for creating lock files and snapshot files.  (FSHard_Link
is implemented with link() from unistd.h on unixen and CreateHardLink() on

> FSFolder
> --------
>                 Key: LUCY-85
>                 URL:
>             Project: Lucy
>          Issue Type: Sub-task
>          Components: Core
>            Reporter: Marvin Humphrey
>            Assignee: Marvin Humphrey
>         Attachments: FSFolder.bp, FSFolder.c,, fsfolder_support.diff, TestFolderCommon.bp,
TestFolderCommon.c, TestFSFolder.bp, TestFSFolder.c
> FSFolder is a file-system-based implementation of Folder.
> FSFolder.c is reasonably compact: 347 lines of code.  This has been made
> possible by offloading as much as possible, e.g. directory iteration into
> FSDirHandle.c (286 lines of code, lots of OS-specific stuff).  
> We should continue to try to put stuff elsewhere, because Folder will tend to
> be the class where OS interaction routines accumulate first.  For instance, I
> think we'll need a Stat class soon.  That way, we can have a single method,
> Folder_Stat(), instead of methods like Folder_Is_Directory(),
> Folder_File_Length(), Folder_Num_Hard_Links(), and so on.
> In order to address thread safety for FSFolder, we'll need to make the
> "entries" Hash thread safe (as we will for all Folder subclasses).  Aside from
> that and reference counting, I think it's pretty close.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message