[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

I've released FileMan on SqueakMap.

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.

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.

- 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

[:masashi | ^umezawa]
Announcements and News from the Squeak Community
Squeak: http://squeak.org/
[hidden email]