[squeak-dev] Re: [ANN] Filesystem 1.0

Colin Putney cputney at wiresong.ca
Sat Nov 21 18:19:56 UTC 2009


Stéphane Ducasse posted this to Pharo-dev, but since I'm not on that  
list, I'll reply here.

On 21-Nov-09, at 2:07 AM, Stéphane Ducasse wrote:

> Hi colin
>
> good that you did that because I was starting to do the same. This  
> file stuff was too frustrating.
>
> - I read the tutorial and I scanned the code (too early this  
> morning) and I could not see how to rename a file.
> without copying it.

You're right. That needs to be implemented. :-)

> - why having this in the tests and not in the classes?
> 	 createDirectory: aString
> 		filesystem createDirectory: (filesystem stringToPath: aString)
> 	createFile: aString
> 		filesystem createFile: (filesystem stringToPath: aString)

That's just a convenience methods for setting up that test. You'll see  
that FSReference>>createDirectory does exist, and you can create a  
file with #writeStreamDo:.

> - It was not clear to me how we map the old interface 	 
> readyOnlyFileNamed and friends

If you open a read stream on a file, it's automatically opened read- 
only. It's only writable if you open a write stream. For  
#forceNewFileNamed:, you open a write stream, then send it #truncate.  
#oldFileNamed: isn't necessary because you get an error if you open a  
read stream on a file that doesn't exist.

> - ref := FSWindowsFilesystem stringToReference: 'D:\Squeak\3.10'.
> I was wondering if reference should be part of the user domain
> because why not
> 	ref := FSWindowsFilesystem on: 'D:\Squeak\3.10'. or
> 	ref := FSWindowsFilesystem folder: 'D:\Squeak\3.10'.
> I was confused by FSReference vs. FSPath

I really need to rewrite the tutorial to de-emphasize paths. You  
should use FSReference for everything. Once I get Eliot's suggestion  
implemented, the above will be:

ref := FSReference D / 'Squeak' / '3.10'.

> - I would really like to see how we can get rid of FileDirectory and  
> use your lib and its improved version.

Slowly and carefully, I think. For now, Filesystem can be a loadable  
package that other apps can depend on. That will let us work out the  
kinks and flesh out the protocols through real-world use. At some  
point, it might make sense to start converting old code that uses  
FileDirectory, write new primitives and so on. But first I just want  
to work through all the issues that people are bringing up.

Thanks,

Colin


More information about the Squeak-dev mailing list