Re: Can't understand why these exceptions occur...
- From: Ikke <ikke@xxxxxxx>
- Date: Sat, 31 May 2008 19:09:22 GMT
Jamie <jamie_ka1lpa_not_valid_after_ka1lpa_@xxxxxxxxxxx> wrote in
news:sbh0k.36$sf2.8@xxxxxxxxxxxx:
<snip>
because you close a file that does not exist!
I'm afraid I have to disagree with you Jamie. From LoadCache:
---
if FileExists(cacheName) then
begin
AssignFile(cache, cacheName);
Reset(cache);
idx := 1;
while Not(eof(cache)) and (idx < Length(files)) do
begin
Read(cache, files[idx]);
Inc(idx);
end;
CloseFile(cache);
end;
---
The file will only be closed if it exists. If it doesn't, it's never
assigned nor closed. Now, from SaveCache:
---
AssignFile(cache, cacheName);
ReWrite(cache);
idx := 1;
while (idx < Length(files)) do
begin
if (files[idx].name <> '') then
begin
Write(cache, files[idx]);
end;
Inc(idx);
end;
CloseFile(cache);
---
Here, I rewrite the file, so it does exist at the time I close it.
So as you can see, there should be no problem with/when closing the file
IMHO.
Thanks,
Ikke
.
- Follow-Ups:
- References:
- Can't understand why these exceptions occur...
- From: Ikke
- Re: Can't understand why these exceptions occur...
- From: Skybuck Flying
- Re: Can't understand why these exceptions occur...
- From: Jamie
- Re: Can't understand why these exceptions occur...
- From: Ikke
- Re: Can't understand why these exceptions occur...
- From: Jamie
- Can't understand why these exceptions occur...
- Prev by Date: Re: Can't understand why these exceptions occur...
- Next by Date: Re: Can't understand why these exceptions occur...
- Previous by thread: Re: Can't understand why these exceptions occur...
- Next by thread: Re: Can't understand why these exceptions occur...
- Index(es):