igir
Version:
🕹 A zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.
64 lines (63 loc) • 1.75 kB
TypeScript
import ProgressBar from '../../console/progressBar.js';
import DAT from '../../types/dats/dat.js';
import File from '../../types/files/file.js';
import Options from '../../types/options.js';
import WriteCandidate from '../../types/writeCandidate.js';
import Module from '../module.js';
export interface CandidateWriterResults {
wrote: File[];
moved: File[];
}
/**
* Copy or move output ROM files, if applicable.
*/
export default class CandidateWriter extends Module {
private static readonly THREAD_SEMAPHORE;
private static readonly FILESIZE_SEMAPHORE;
private static readonly MOVE_MUTEX;
private static readonly FILE_PATH_MOVES;
private readonly options;
private readonly filesQueuedForDeletion;
constructor(options: Options, progressBar: ProgressBar);
/**
* Write & test candidates.
*/
write(dat: DAT, candidates: WriteCandidate[]): Promise<CandidateWriterResults>;
private writeCandidate;
private static ensureOutputDirExists;
/**
***********************
*
* Zip Writing *
*
***********************
*/
private writeZip;
private testZipContents;
private writeZipFile;
/**
***********************
*
* Raw Writing *
*
***********************
*/
private writeRaw;
private writeRawSingle;
private moveRawFile;
private copyRawFile;
private testWrittenRaw;
private enqueueFileDeletion;
/**
************************
*
* Link Writing *
*
************************
*/
private writeLink;
private writeLinkSingle;
private writeRawLink;
private static testWrittenSymlink;
private static testWrittenHardlink;
}