ACAT.Lib.Core.Utility.FileUtils.Copy C# (CSharp) Метод

Copy() публичный статический Метод

Copies the spcified source to target. IF source is a folder, recursively copies source to target
public static Copy ( String source, String target ) : bool
source String source file or dir
target String target
Результат bool
        public static bool Copy(String source, String target)
        {
            bool retVal = true;
            try
            {
                var fileAttr = File.GetAttributes(source);
                if ((fileAttr & FileAttributes.Directory) == FileAttributes.Directory)
                {
                    retVal = CopyDir(source, target, true);
                }
                else
                {
                    File.Copy(source, target, true);
                }
            }
            catch (Exception ex)
            {
                Log.Debug(ex.ToString());
                retVal = false;
            }

            return retVal;
        }