[ANN] FileMan on SqueakMap

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ANN] FileMan on SqueakMap

Masashi UMEZAWA-2
Hi,

I've released FileMan on SqueakMap.
http://map.squeak.org/package/f9917683-25da-4a6c-a013-b36527a100c1

Squeak's file libraries (Directory, DirectoryEntry, FileStream, etc.)
are sometimes very confusing to use. FileMan provides a simple,
refactored interfaces for manipulating files and directories by
wrapping those classes.

"Before"
subDir := FileDirectory default directoryNamed: 'subDir'.
subDir assureExistence.
[str := subDir newFileNamed: 'file1'.
str nextPutAll: 'Hello!']
ensure: [str close].

"After installation of FileMan"
'./subDir' asDirectoryEntry at: 'file2' put: 'Hello!'.

Another example:
"Copy all contents in ./doc to ./bkup/yymmdd (for daily backup)"
'./doc' asDirectoryEntry copyTo: './bkup' / Date today yyyymmdd.

Features:
- Path representation is portable (the example code runs on Windows,
Mac, Linux).
- Small package (consists of just two classes - FmDirectoryEntry, FmFileEntry)
- Basic file operations
- Dictionary-like operations
- Pipe-like operations
- Zip archive operations

Enjoy!
--
[:masashi | ^umezawa]
_______________________________________________
Announcements and News from the Squeak Community
Squeak: http://squeak.org/
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/announcements