|
OK, I was _this_ -->| |<-- close to posting a plea for help regarding a
problem I had with File class>>forAll:in:do:, but acting on a hunch seems to
have solved it; thus, this post is for the benefit of possible future
googlers.
Making a small jukebox app for shuffling my mp3 files and copying some of
them to my player, I started off with:
c := OrderedCollection new.
File forAll: '*.mp3' in: 'C:\MyTotallyLegallyAcquiredMP3s\' do: [:f | c add:
f].
-- assuming that c would hold one WIN32_FIND_DATA for each mp3 in and below
the indicated directory. However, even though the _number_ of elements in c
was correct, many of them were equal, and consequently many of the mp3s did
not have an entry at all.
The problem seems to have been solved by changing the block to [:f | c add:
f copy] -- apparently, the WIN32_FIND_DATA objects were originally reused,
or something?
--
OleM
|