windows - OSX 上的 XCOPY 命令
问题描述
我继承了一个在 Windows 机器上构建的遗留项目。我在 OSX 中工作,构建命令之一是:
xcopy /y /r /i /d $(TargetDir)*.* $(TargetDir)$(ConfigurationName)
我几乎没有在 Windows 中工作的经验;但需要替换它才能使构建顺利运行。
如何在 OSX 上运行它?
解决方案
Xcopy is a DOS / Windows command. To my knowledge there is no way to runs this directly on Mac.
xcopy basically just copy files from one directory to another. Your command runs with these switches:
/y Suppresses prompting to confirm that you want to overwrite an existing destination file.
/r Copies read-only files.
/i If Source is a directory or contains wildcards and Destination does not exist, xcopy assumes Destination specifies a directory name and creates a new directory. Then, xcopy copies all specified files into the new directory. By default, xcopy prompts you to specify whether Destination is a file or a directory.
/d Copies source files changed on or after the specified date only. If you do not include a MM-DD-YYYY value, xcopy copies all Source files that are newer than existing Destination files. This command-line option allows you to update files that have changed.
You could use a tool available on Mac that does something similar instead, such as rsync.
So basically to do the same, you just need to copy things from one folder to another and keep in mind the different switches to take into account how it chooses what to copy.
推荐阅读
- c# - 在 C# 控制台应用程序中使用 GOTO。改变主意,这是一个坏主意
- javascript - 导航单击时切换菜单不会关闭
- sql - SQL Server 2014 命令将文件写入服务器?
- elasticsearch - 在 ElasticSearch 中添加自定义标签
- qt - 为什么每次进入同一个函数,内存地址都是一样的?
- html - 在数据内容中显示一个弹出框
- excel - 重命名多个子文件夹中的txt文件
- c# - Assembly.LoadFile 和 CreateInstance ... StrongName 是必须的吗?
- javascript - 如何删除前置的兄弟项目
- sas - 从输出表中获取平均值