Beispiel #1
0
int archiveOpen(char *file) {
	// Start position of the archive path
	archive_path_start = strlen(file) + 1;

	// Close previous zip file first
	if (uf)
		unzClose(uf);

	// Open zip file
	uf = unzOpen64(file);
	if (!uf)
		return -1;

	// Clear archive list
	memset(&archive_list, 0, sizeof(FileList));

	// Go through all files
	int res;
	char name[MAX_PATH_LENGTH];
	unz_file_info64 file_info;

	res = unzGoToFirstFile2(uf, &file_info, name, MAX_PATH_LENGTH, NULL, 0, NULL, 0);
	if (res < 0)
		return res;

	while (res >= 0) {
		FileListEntry *entry = malloc(sizeof(FileListEntry));

		// File info
		strcpy(entry->name, name);
		entry->is_folder = 0;
		entry->name_length = file_info.size_filename;
		entry->size = file_info.uncompressed_size;
		entry->size2 = file_info.compressed_size;

		// Time
		SceDateTime time;
		sceRtcSetDosTime(&time, file_info.dosDate);
		convertLocalTimeToUtc(&time, &time);

		memcpy(&entry->ctime, &time, sizeof(SceDateTime));
		memcpy(&entry->mtime, &time, sizeof(SceDateTime));
		memcpy(&entry->atime, &time, sizeof(SceDateTime));

		// Get pos
		unzGetFilePos64(uf, (unz64_file_pos *)&entry->reserved);

		// Add entry
		fileListAddEntry(&archive_list, entry, SORT_BY_NAME);

		// Next
		res = unzGoToNextFile2(uf, &file_info, name, MAX_PATH_LENGTH, NULL, 0, NULL, 0);
	}

	return 0;
}
Beispiel #2
0
void checkRtcSetDosTime()
{
	printf("Checking sceRtcSetDosTime\n");

	pspTime pt;

	printf("from epoc:%d\n",sceRtcSetDosTime(&pt, 62135596800000000ULL));
	printf("%d, %d, %d, %d, %d, %d, %d\n", pt.year, pt.month, pt.day, pt.hour, pt.minutes, pt.seconds, pt.microseconds);


}