Page 1 of 1

DeleteFile() error

Posted: Tue May 10, 2011 7:55 pm
by djrikki
Hello,

Having an unusual problem, if I delete a file, refresh the directory and sometime later try to save a brush with the same filename it reports:

Cannot write to file blahblah.png

File: imageprocessing.hws (current line: 863 - In Function: SaveBrush)

Clueless.

EDIT: Also, if I create new brushes and save them to disk, use FreeBrush to remove them from memory and then try to delete the files it won't let me. No error message is thrown this time, it just won't delete them.

Re: DeleteFile() error

Posted: Tue May 10, 2011 8:18 pm
by djrikki
Ahhh, might have spotted the error. Always use CloseDirectory() after issuing an OpenDirectory().

EDIT: Hmm don't actually use OpenDirectory(), I do use ChangeDirectory() though... so I guess that's not it.

Re: DeleteFile() error

Posted: Tue May 10, 2011 8:45 pm
by djrikki
Nvm, somewhere in my application the variables 'current' and 'directory' are being emptied lol