The only possible thing I can think of is that the file is currently checked out or locked for editing by another user. Try this...
SPWeb web = SPControl.GetContextWeb(WebPart.WebPartContext);
SPList list = web.GetList(web.Site.Url + "/ListName");
SPFile file = list.GetItemByUniqueId(new Guid(fileId)).File;
if (file.CheckOutStatus != SPFile.SPCheckOutStatus.None)
{
file.UndoCheckOut();
file.CheckOut();
}
file.Delete();
Fraser
2010-09-08 00:01:13