function future = replicateFolders(pool, name)
% parallel.pool.replicateFolders copies per-host files to per-worker folders
%    F = parallel.pool.replicateFolders(POOL, SUBFOLDER) ensures that all files in the
%    per-host subfolder SUBFOLDER are copied to the corresponding per-worker
%    subfolders. F is a parallel.FevalOnAllFuture which can be used to
%    ensure that the copy executed successfully - on successful completion, the
%    value TRUE is returned. 

% Copyright 2014-2017 The MathWorks, Inc.

% Convert any string inputs to character vectors
name = convertStringsToChars(name);

validateattributes(pool, {'parallel.Pool'}, {'scalar'});
validateattributes(name, {'char'}, {'row', 'nonempty'});
future = replicateFolders(...
    parallel.internal.pool.FolderManagement.getForPool(pool), name);
end
