[squeak-dev] Re: [ANN] Filesystem 1.0
Andreas Raab
andreas.raab at gmx.de
Sat Nov 21 05:21:09 UTC 2009
Colin Putney wrote:
> Feedback appreciated!
I guess the big question here is: To what extent is this a feasible
replacement of FileDirectory and/or [Standard|CrLf|MultiByte]FileStream?
Besides that, a couple of smaller comments and questions:
* How does one convert 'D:\Squeak\3.10' to the equivalent to a
FileDirectory? I.e., what's the equivalent to
fd := FileDirectory on: 'D:\Squeak\3.10'.
and then (to make the example more concrete):
(fd fileNamesMatching:'*.txt') do:[:oldName|
newName := (oldName allButLast: 4),'.bak'.
[oldFile := fd readOnlyFileNamed: oldName.
newFile := fd forceNewFileNamed: newName.
fd copyFile: oldFile toFile: newFile] ensure:[
oldFile close.
newFile close.
].
].
* What about Windows \\shares\? Many (most?) network file systems aren't
mapped to drives any longer so the access to \\shares\ is fairly important.
* Nitpick: On Windows, FSPlatformTest>>testHome will generally fail.
That's because the home location is different between Windows versions
(it's C:\Documents and Settings\ on XP, C:\Users on Vista and Windows 7)
but also because that path is localized (i.e., "Dokumente und
Einstellungen" on a German XP variant). Your best guess (short of a
dedicated primitive) is currenty
(FileDirectory on: SecurityManager default untrustedUserDirectory)
containingDirectory containingDirectory
since the untrustedUserDirectory nowadays defaults to <home>\My
Documents\My Squeak (unless overridden).
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|