Upload
niklaus-schlichte
View
117
Download
9
Embed Size (px)
Citation preview
Intelligente Dateisysteme
Einführende Bemerkungen
Manfred Thaller, Universität zu Köln
Köln 17. Oktober 2013
I. Hardcore
Binäres Lesen (Qt flavour)
3
Annahme:
Eine Datei ist eine lineare Sequenz von Bytes.
Diese werden vom Beginn an mit einem Offset gezählt.
Eine Datei kann also als Array auf der Festplatte verstanden werden.
Byte 0Byte 1
Byte n -1Byte n
Inhalt
Binäres Lesen (Qt flavour)
5
„Lesen“
imageFile.seek(ifd_addr);imageFile.read((char *)buffer,n);
„Schreiben“imageFile.seek(ifd_addr);imageFile.write((char *)buffer,n);
„Position merken“ifdstart = imageFile.pos();
Binäres Lesen (C - Directories)
6
struct dirent *dp;DIR *dir;
if ( (dir=opendir(“/x/y/z”)! = NULL) { for (dp=readdir(dir); dp!=NULL; dp=readdir(dir)) {// Directory Entry bearbeiten … } closedir(dir); }
Binäres Lesen (C - Directories)
7
struct dirent { __ino_t d_ino; __off_t d_off; unsigned short int d_reclen; unsigned char d_type; char d_name[256]; };
II. Dateiformate
A deterministic specification how the properties of a digital object can reversibly be converted into a linear bytestream (bitstream).
File format
File format: TIFF
Image width: 277
Image length: 339
Compression: uncompressed
File format: TIFF
<?xml version="1.0" encoding="UTF-16"?> <svg:svg width="800" height="1000" xmlns:svg="http://www.w3.org ... <svg:rect x="0" y="0" width="800" height="1000" fill="white" /> <svg:g transform="translate(-140,0)"> <svg:line x1="600" y1="20" x2="500" y2="20" stroke="black" … <svg:text x="600" y="28.8" font-size="6" fill="black" … </svg:g> <svg:g transform="translate(-140,0)"> <svg:text x="500" y="24.4"> <svg:tspan font-size="4" fill="black">Leiste</svg:tspan> </svg:text> </svg:g> <svg:defs> <svg:g id="halbeSaeuleLeiste0">
File format: SVG
File format: SVG
III. Dateien => Objekten
Byte 0Byte 1
Byte n -1Byte n
Inhalt
Byte 0Byte 1
Byte n - 1Byte n == coByte co + 0Byte co + 1
Byte co + m -1Byte co + m
Payload
Context
IV. Ziele
Intelligent, wenn: eine Datei sich die richtige Software sucht … … über ein paar hundert Jahre hinweg.
Intelligente Datei(systeme) ...