Wrapper to the add_filepath function in PayuManifest. Prevents outside
        code from directly calling anything in PayuManifest.
337301
def add_filepath(self, manifest, filepath, fullpath, copy=False):
        
        filepath = os.path.normpath(filepath)
        if self.manifests[manifest].add_filepath(filepath, fullpath, copy):
            # Only link if filepath was added
            self.manifests[manifest].make_link(filepath)
653946
protected function wizardAddFile()
    {
        $this->validatePrompt('path', $this->text('Path'), 'file');
        $this->validatePrompt('entity', $this->text('Entity'), 'file');
        $this->validatePrompt('entity_id', $this->text('Entity ID'), 'file', 0);
        $this->validatePrompt('title', $this->text('Title'), 'file', '');
        $this->validatePrompt('description', $this->text('Description'), 'file', '');
        $this->validatePrompt('weight', $this->text('Weight'), 'file', 0);

        $this->validateComponent('file');
        $this->addFile();
    }
111145
function addIgnoreFile(ig, filepath) {
        if (fs.existsSync(filepath)) {
          ig.add(fs.readFileSync(filepath).toString());
        }
        return ig;
    }
709866
def link(self, title, path):
        '''
        
        '''
        # The filehandler needs to be explicitly passed here, so PyLint needs to accept that.
        # pylint: disable=W8470
        if not isinstance(path, file):
            path = salt.utils.files.fopen(path)
        self.__current_section.append({title: path})
883763
def add_file(path, **kwords)
      # Don't mangle query, the file API is inconsistently using camelCase
      # rather than CamelCase.
      response = connection.send(:post, "/repos/#{self.Name}/file/#{path}",
                                 query: kwords,
                                 query_mangle: false)
      hash = JSON.parse(response.body)
      error = Errors::RepositoryFileError.from_hash(hash)
      raise error if error
      hash['Report']['Added']
    end
252879
def add_file_path_in_work_tree(self, path, work_tree, verbose=True):
        
        args = ['--work-tree', work_tree, 'add', '-f']
        if verbose:
            args.append('--verbose')
        args.append(path)
        self.command_exec(args, show_output=verbose)
297060
def add_file(self, filename, overwrite=False):
        

        with open(filename, 'r') as fin:
            self.add(fin.read(), overwrite)
190583
function processSourceFile(work_directory, file_path) {

    var path = create('fs.path', work_directory).combine(file_path),
        source = create('fs.filereader(utf8)', path).readSync();

    // replace /*#include filename.ext*/
    var result = source.replace(/\/\*#include \S+\*\//gm, function(line) {
        var include_file_path = /\/\*#include (\S+)\*\//.exec(line)[1];
        // list .js file
        watch_list.push(include_file_path);
        // recursively perform substitutions
        return processSourceFile(path.getParentPath().path, include_file_path);
    });

    return result;
}
978017
def add_blacklisted_filepaths(self, filepaths, remove_from_stored=True):
        
        self.file_manager.add_blacklisted_filepaths(filepaths,
                                                    remove_from_stored)
1108502
def include_file(member,file_filter):
    '''
    '''
    member_path = member.name.replace('.','',1)

    if len(member_path) == 0:
        return False

    # Does the filter skip it explicitly?
    if "skip_files" in file_filter:
        if member_path in file_filter['skip_files']:
            return False

    # Include explicitly?
    if "include_files" in file_filter:
        if member_path in file_filter['include_files']:
            return True

    # Regular expression?
    if "regexp" in file_filter:
        if re.search(file_filter["regexp"],member_path):
            return True
    return False
1251560
def setFilepath( self, filepath ):
        
        self._filepath = nativestring(filepath)
        self.setIcon(QIcon(filepath))
        if ( not self.signalsBlocked() ):
            self.filepathChanged.emit(filepath)
705436
def add_filepath(self, filepath, fullpath, copy=False):
        

        # Ignore directories
        if os.path.isdir(fullpath):
            return False

        # Ignore anything matching the ignore patterns
        for pattern in self.ignore:
            if fnmatch.fnmatch(os.path.basename(fullpath), pattern):
                return False

        if filepath not in self.data:
            self.data[filepath] = {}

        self.data[filepath]['fullpath'] = fullpath
        if 'hashes' not in self.data[filepath]:
            self.data[filepath]['hashes'] = {hash: None for hash in all_hashes}

        if copy:
            self.data[filepath]['copy'] = copy

        if hasattr(self, 'existing_filepaths'):
            if filepath in self.existing_filepaths:
                self.existing_filepaths.remove(filepath)

        return True
206954
def add_path(self, path, path_filter=None):
        
        for root, _, files in os.walk(path):
            for filename in files:
                full_path_and_filename = os.path.join(root, filename)
                if path_filter is None or path_filter(full_path_and_filename):
                    relative_path_and_filename = full_path_and_filename.replace(path + '/', '')
                    with open(full_path_and_filename, 'rb') as handle:
                        self.files[relative_path_and_filename] = b64encode(handle.read()).decode('utf-8')
1234328
def add_file(self, resource_list=None, dir=None, file=None):
        
        try:
            if self.exclude_file(file):
                self.logger.debug("Excluding file %s" % (file))
                return
            # get abs filename and also URL
            if (dir is not None):
                file = os.path.join(dir, file)
            if (not os.path.isfile(file) or not (
                    self.include_symlinks or not os.path.islink(file))):
                return
            uri = self.mapper.dst_to_src(file)
            if (uri is None):
                raise Exception("Internal error, mapping failed")
            file_stat = os.stat(file)
        except OSError as e:
            sys.stderr.write("Ignoring file %s (error: %s)" % (file, str(e)))
            return
        timestamp = file_stat.st_mtime  # UTC
        r = Resource(uri=uri, timestamp=timestamp)
        if (self.set_path):
            # add full local path
            r.path = file
        if (self.set_hashes):
            hasher = Hashes(self.set_hashes, file)
            if ('md5' in self.set_hashes):
                r.md5 = hasher.md5
            if ('sha-1' in self.set_hashes):
                r.sha1 = hasher.sha1
            if ('sha-256' in self.set_hashes):
                r.sha256 = hasher.sha256
        if (self.set_length):
            # add length
            r.length = file_stat.st_size
        resource_list.add(r)
878918
public function addAttachment ($filePath = FALSE, $fileName = NULL, $fileData = FALSE, $mimeType = 'text/plain')
    {

        // If its an existing file

        if ($filePath !== FALSE)
        {

            // Check File Exists

            if (!file_exists ($filePath))
            {

                // Add error and return false

                new \Sonic\Message ('error', $filePath . ' doesnt exist!');
                return FALSE;

            }

            // Get MIME Type

            $objFinfo   = new finfo;

            if (!$mimeType = $objFinfo->file ($filePath, FILEINFO_MIME))
            {

                // Add error and return false

                new \Sonic\Message ('error', 'Cannot get MIME type!');
                return FALSE;

            }

            // Get File Data

            if (!$fileData = @file_get_contents ($filePath))
            {

                // Add error and return false

                new \Sonic\Message ('error', 'Cannot get attachment data!');
                return FALSE;

            }

        }
        else if (!$fileData || !$fileName)
        {

            // Add error and return false

            new \Sonic\Message ('error', 'Invalid Attachment!');
            return FALSE;

        }

        // Set attachments boolean

        $this->_attachmentsSet	= TRUE;

        // Add Attachment

        $this->_attachments[]	= array (
            'name'		=> $fileName,
            'data'		=> $fileData,
            'type'		=> $mimeType
        );

        // Return TRUE

        return TRUE;

    }
1254058
function addCompressionToFile(filePath, compression) {
        var srcFilePath = filePath.replace(rootFolder, "").replace(compression.fileExtension, "");
        var existingFile = files[srcFilePath];
        if (!existingFile) {
            files[srcFilePath] = { compressions: [compression] };
        } else {
            existingFile.compressions.push(compression);
        }
    }
668115
function addFileToQueue(filename, callback){
  if (processingPaths[filename]) {
    if (typeof callback == 'function')
      processingPaths[filename].unshift(callback);

    return;
  }

  processingPaths[filename] = typeof callback == 'function'
    ? [callback].concat(readCallbacks)
    : readCallbacks.slice();

  if (readingCount < READ_LIMIT)
    readFile(filename);
  else
  {
    logMsg('fs', relativePath(filename) + ' ' + chalk.yellow('(add file to queue)'), true);
    filesToRead.push(filename);
  }
}