 |
Changeset 3551
- Timestamp:
- 06/03/08 17:30:36
(6 months ago)
- Author:
- kris
- Message:
migrating from FileScan? to vfs.FileFolder?
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r3128 |
r3551 |
|
| 2 | 2 | |
|---|
| 3 | 3 | import tango.io.archive.Zip; |
|---|
| 4 | | import tango.io.FileScan; |
|---|
| 5 | | import tango.io.Stdout; |
|---|
| | 4 | import tango.io.vfs.FileFolder; |
|---|
| 6 | 5 | |
|---|
| 7 | 6 | /****************************************************************************** |
|---|
| … | … | |
| 14 | 13 | ******************************************************************************/ |
|---|
| 15 | 14 | |
|---|
| 16 | | void main(){ |
|---|
| 17 | | auto scan = (new FileScan)(".", ".d"); |
|---|
| 18 | | char[][] files; |
|---|
| 19 | | foreach (file; scan.files) |
|---|
| 20 | | files ~= file.toString; |
|---|
| | 15 | void main() |
|---|
| | 16 | { |
|---|
| | 17 | char[][] files; |
|---|
| | 18 | auto root = new FileFolder ("."); |
|---|
| | 19 | foreach (file; root.tree.catalog ("*.d")) |
|---|
| | 20 | files ~= file.toString; |
|---|
| 21 | 21 | |
|---|
| 22 | | createArchive("tmp.zip", Method.Deflate, files); |
|---|
| | 22 | createArchive("tmp.zip", Method.Deflate, files); |
|---|
| 23 | 23 | } |
|---|
| r3547 |
r3551 |
|
| 1 | 1 | |
|---|
| 2 | 2 | private import tango.io.Console, |
|---|
| 3 | | tango.io.FileScan, |
|---|
| 4 | | tango.io.model.IFile; |
|---|
| | 3 | tango.io.model.IFile, |
|---|
| | 4 | tango.io.vfs.FileFolder; |
|---|
| | 5 | |
|---|
| | 6 | private import Path = tango.io.Path; |
|---|
| 5 | 7 | |
|---|
| 6 | 8 | /******************************************************************************* |
|---|
| … | … | |
| 19 | 21 | { |
|---|
| 20 | 22 | // sweep all html files in the specified subdir |
|---|
| 21 | | if (args.length is 2) |
|---|
| 22 | | foreach (proxy; (new FileScan).sweep(args[1], ".html").files) |
|---|
| 23 | | { |
|---|
| 24 | | auto other = new FilePath (proxy.toString); |
|---|
| 25 | | proxy.rename (other.replace (FileConst.PathSeparatorChar, '.')); |
|---|
| 26 | | } |
|---|
| | 23 | if (args.length !is 2) |
|---|
| | 24 | Cout ("usage is filebubbler subdir").newline; |
|---|
| 27 | 25 | else |
|---|
| 28 | | Cout ("usage is filebubbler subdir").newline; |
|---|
| | 26 | foreach (file; (new FileFolder(args[1])).tree.catalog("*.html")) |
|---|
| | 27 | Path.rename (file.toString, Path.replace (file.toString.dup, FileConst.PathSeparatorChar, '.')); |
|---|
| 29 | 28 | } |
|---|
| 30 | 29 | |
|---|
Download in other formats:
|
 |
 |
|
 |
Copyright © 2006-2008 Tango. All Rights Reserved. | Page Width:
Static or
Dynamic