[BUG] FileDirectory>>exists

Lukas Renggli renggli at hotmail.com
Wed May 21 10:44:32 UTC 2003


> testAttemptExistenceCheckWhenFile > "How should a FileDirectory 
> instance respond with an > existent file name?" >| directory | > 
> FileDirectory default > 				forceNewFileNamed: 'aTestFile'. > 
> directory := FileDirectory default > 				directoryNamed: 'aTestFile'.
> > self shouldnt: [directory exists] > 	description: 'Files are not 
> directories.'. >  > Lukas, is the assertion made by the above test 
> case is > what you're expecting? If not please explain in a test > 
> what you expect.
 Yes, that is exactly what I expect to be returned. 
> Again, this test fails on Mac OS X, but not under Windows.
 > *Should 
> we be able to create a FileDirectory instance > even when a file 
> exists of the same name in the > indicated location? Should an error 
> be thrown or > should we be able to do so and it be up to the sender > 
> to check for name conflicts.?
 In my personal opinion it is quite 
> painful to work with FileDirectory. Especially when working with 
> specific files, you always have to remember two things: the 
> FileDirectory and the String with the filename. It would be great to 
> have a more sophisticated (and oo) way of working with files. 
 My 
> idea would be to have a new class called Filename that represent files 
> only. As a result, we would be able to move a lot of stuff from 
> FileDirectory to Filename. Like this - I think - we get rid of that 
> kind of problems. Some examples could be:

	
> FileDirectory>>newFileNamed: localFileName
	Filename>>writeStream
	
	
> FileDirectory>>copyFileNamed: fileName1 toFileNamed: fileName2
	
> Filename>>copyToDirectory: aFileDirectory
		 Tell me what do you think 
> about this. I would be eventually able to come up with a more detailed 
> proposal.

Cheers
Lukas

-- 
Lukas Renggli
http://renggli.freezope.org



More information about the Squeak-dev mailing list