- //importjava.net commons
FileTools.copyFile("foo.txt", "bar.txt"); - //antbuilder (no import needed!)
( new AntBuilder ( ) ).copy ( file : 'blah' , tofile : 'fobar' ) - //apache commons io
org.apache.commons.io.FileUtils.copyFile(srcfile, targetFile) - //simply copy text file with write/text methods
new File('SRC_FILE').write(new File('TO_FILE').text) -
static void copyFile(File source, File destination) {
def reader = source.newReader()
destination.withWriter { writer ->
writer << reader
}
reader.close()
} - //with shell under unix
'cp SRC TARGET'.execute() - //with shell under window
'copy SRC TARGET'.execute()
2008年8月4日
Tricks of Groovy - Copy File
訂閱:
張貼留言 (Atom)
-
▼
2008
(241)
-
▼
8月
(55)
- Big Bang! 軟體開發的黑箱作業
- PHP存取MS SQL Server的新方法
- 研究生必備之Firefox論文工具
- Hot, Flat, and Crowded
- 成功專案管理的四要素
- 別再去想複雜難題
- Commands for cracking BPFTP Server
- 換一部新的無線基地台
- TOSHIBA Satellite M300
- Power up Twitter with Firefox
- 天瓏訂書單 20080825
- Beginning Groovy and Grails: From Novice to Profes...
- 溫伯格的軟體管理學-第一級評量 (第二卷)
- 解決 vmware-server 無法啟動問題
- 程式設計與真實人生
- Wiimote DIY互動式電子白板
- 開放源碼的市場
- Eee PC 變身 Tablet PC
- Sakai 2.5.2 課程資料同步
- Sakai的ContentHostingService問題
- 網站分享, 免費資源網路社群
- Yahoo! Open Hack Day 2008
- 好貴的CCNA認證費用
- 周盟桂的電視採訪剪輯
- 知識工作之鑰
- iPod Touch firmware 2.0 支援手寫
- 回歸寫Blog的初衷
- 拋棄式Groovy - CSV資料轉PHP陣列
- 部落格交換連結
- soapUI; the Web Services Testing tool
- YUI 3.0 Preview Release 1
- Tweak Network 讓Firefox跑得更快
- 程序員! 教你工作更輕鬆
- Blogger大改造 Action One
- The Productive Programmer
- PLEAC - Programming Language Examples Alike Cookbook
- 一個提供IT電子書網站
- 專業的.伏立挺身網站
- Scripting Language快速修改的好處
- Access mdb files in Linux
- "我是好野人" iPhone App
- Linux下的超棒MSN Client - Galaxium
- 適合單車環島的車款
- 讓部落格告訴你自己有多宅!
- Wordpress MU入侵事件*續1
- Wordpress MU入侵事件
- Groovy入門123 - 檔案列表篇
- J2EE RIA i18n&l10n solutions
- Picasa FileSystem 相簿變硬碟 Linux篇
- Nagios, open source host/server/network monitoring...
- Tricks of Groovy - Copy File
- Extjs的簡體中文電子書
- Groovy對程式設計學習的幫助
- Groovy入門123 - 安裝篇
- ST3640323AS 640GB硬碟低價高效能
-
▼
8月
(55)
沒有留言:
張貼留言