<commit_before>/****************************************************0***************************
 * @license
 * Copyright (c) 2013 VMware, Inc. All Rights Reserved.
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *   <NAME>
 ******************************************************************************/

//
// A composite fs puts together a number of other filesystems in a kind of
// pipe-line.
//
// For directory listing requests the results of each child system
// are combined into a single list of results.
//
// For file-based request the filesystems are considered left-to-right
// so that the first file system from the left that 'has the file' takes
// priority.

var when = require('when');
var promiseUtils = require('../utils/promises');

var filter = promiseUtils.filter;
var until = promiseUtils.until;
var each = promiseUtils.each;
var not = promiseUtils.not;
var findFirst = promiseUtils.findFirst;
var findFirstIndex = promiseUtils.findFirstIndex;
var noExistError = require('./fs-errors').noExistError;
var isDirError = require('./fs-errors').isDirError;
var isNotDirError = require('./fs-errors').isNotDirError;<commit_msg>Some comments added to composite-fs about the semantics of composition in corner cases.<commit_after>/****************************************************0***************************
 * @license
 * Copyright (c) 2013 VMware, Inc. All Rights Reserved.
 * THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
 * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
 * CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
 * You can obtain a current copy of the Eclipse Public License from
 * http://www.opensource.org/licenses/eclipse-1.0.php
 *
 * Contributors:
 *   <NAME>
 ******************************************************************************/

//
// A composite fs puts together a number of other filesystems in a kind of
// pipe-line.
//
// For directory listing requests the results of each child system
// are combined into a single list of results.
//
// For file-based request the filesystems are considered left-to-right
// so that the first file system from the left that 'has the file' takes
// priority.
//
// When subsystems define a mix of files / dirs for a given handle
// the siutation is amibguous. We try to resolve these conflicts logically
// as much as possible by assuming left-most filesystem has priority.
// The semantics of composition and particularly mutation operations
// like writeFile, unlink, rmdir are not always clear however
// and it is probably best to avoid these situations by only composing file
// systems that are mostly disjoint.

var when = require('when');
var promiseUtils = require('../utils/promises');

var filter = promiseUtils.filter;
var until = promiseUtils.until;
var each = promiseUtils.each;
var not = promiseUtils.not;
var findFirst = promiseUtils.findFirst;
var findFirstIndex = promiseUtils.findFirstIndex;
var noExistError = require('./fs-errors').noExistError;
var isDirError = require('./fs-errors').isDirError;
var isNotDirError = require('./fs-errors').isNotDirError;
{'fraction_non_alphanumeric': 0.17837202468410226, 'fraction_numerical': 0.004114017043784896, 'mean_word_length': 4.517017828200973, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3379167', 'n_tokens_mistral': 910, 'n_tokens_neox': 861, 'n_words': 361}