public boolean deleteFile(String filename, int resID)
    {
        // check for errors first
        if (resID == -1 || filename == null) {
            return false;
        }

        Object[] packet = new Object[2];
        packet[0] = filename;
        packet[1] = myID_;

        // send the event
        super.send(super.output, 0, DataGridTags.FILE_DELETE_REPLICA,
                   new IO_data(packet, DataGridTags.PKT_SIZE, resID));

        // wait for ACK
        int tag = DataGridTags.FILE_DELETE_REPLICA_RESULT;
        FilterDataResult type = new FilterDataResult(filename, tag);
        Sim_event ev = new Sim_event();
        super.sim_get_next(type, ev);

        boolean result = false;
        try
        {
            packet = (Object[]) ev.get_data();
            String resName = GridSim.getEntityName(resID);
            int msg = ((Integer) packet[1]).intValue();
            if (msg == DataGridTags.FILE_DELETE_SUCCESSFUL) {
                result = true;
                System.out.println(super.get_name() + ".deleteFile(): " +
                        filename + " has been deleted from " + resName);
            }
            else {
                System.out.println(super.get_name() + ".deleteFile(): " +
                        "There was an error in deleting " + filename +
                        " from " + resName);
            }

        }
        catch (Exception e) {
            System.out.println(super.get_name() + ".deleteFile(): Exception");
            result = false;
        }
        return result;
    }