public int deleteFile(final String directory, final String name) {
		final String path = directory + "/" + name; 
		
		int error = 0;
		
		final Integer fileNode = fileTable.containsKey(path) ? fileTable.get(path) : -1;

		if( fileNode != null && fileNode != -1 && Utils.range(fileNode, 0, MAX_FILES) ) {
			final File file = files.get(fileNode);

			boolean delete_ok = true;

			// assuming the file isn't null
			if( file.isDir ) {
				if( file.getContents().length != 0 ){
					delete_ok = false;
					error = ERR_NONEMPTY_DIR;
				}
			}

			if( delete_ok ) {
				fileTable.remove(path);
				files.set(fileNode, null);

				for(int n = 0; n < files.size(); n++) {
					if( files.get(n) == null ) {
						firstUnused = n;
						break;
					}
				}
			}
		}
		else {
			error = ERR_FILE_DOES_NOT_EXIST;
		}

		return error;
	}