Verfügbare Informationen zu "Mp3 Tag lesen ?"
Qualität des Beitrags: Beteiligte Poster: exbs - DrPhil_Guth Forum: Tutorials.at Forenbeschreibung: Programmierforum aus dem Unterforum: C / C++ Antworten: 12 Forum gestartet am: Mittwoch 19.04.2006 Sprache: deutsch Link zum Originaltopic: Mp3 Tag lesen ? Letzte Antwort: vor 16 Jahren, 2 Monaten, 2 Tagen, 44 Minuten Getaggt durch: MP3
Alle Beiträge und Antworten zu "Mp3 Tag lesen ?"
Re: Mp3 Tag lesen ?
exbs - 09.01.2007, 01:39Mp3 Tag lesen ?
Also ich bin grad dabei ein Programm zu coden, welches eine Mp3, die noch keine Taginfos enthält, beschreibt. Die Datei hat von meinem Inetradioprog nen Namen mit Interpret und Titel (Bsp: mr.x - title.mp3). Dieses Format ist immer gleich und von einem Bindestrich ( - ;) ) getrennt, was ein Parsen nicht schwer macht. Soweit alles io. Ordner gelesen, Dateinamen geholt, und geparst, so aber nun ist das Problem, wie schreibe ich in den Mp3 Tag (v1, v2 .. ist jetzt erstmal egal). Ich habe mir schon ein paar grundlegende Infos zu den Headern besorgt (besonders schlau bin ich daraus nicht geworden :roll: http://de.wikipedia.org/wiki/ID3-Tag#ID3v1) . Nur wie stelle ich es am günstigsten an ? Hat soetwas schon einmal jemand von euch gemacht ?
Re: Mp3 Tag lesen ?
DrPhil_Guth - 09.01.2007, 17:22
Puh, also sieht aus als wäre das keine leichte aufgabe.
Du müsstest 3 dinge machen:
1. Bibliotheken besorgen, die das können ( z.B. hier: http://www.id3.org/Implementations )
2. Die dokumentation lesen (z.B. hier http://www.id3.org/Developer_Information )
3. Dein Wissen in irgendeine Klasse oder Funktionssammlung packen, damit der umgang damit kein problem mehr ist.
Also auf jeden fall klingt das nach nem haufen arbeit.
Ich biete meine hilfe an, ich wollte schon immer mal was "richtiges" Programmieren. Natürlich nur wenn du einverstanden bist.
Re: Mp3 Tag lesen ?
exbs - 09.01.2007, 18:19
Hab mir das jetz noch nicht alles durchgelsen, werd ich nacher machen.
Deine hilfe nehmen ich gerne an, weil, wie du schon recht sagst, es ist nen haufen arbeit.
aba ich habe noch eine grundlegenede frage: wie durchsuche ich die datei nach diesen informationen, wenn ich ungefähr weis wo sie in liegen?
Re: Mp3 Tag lesen ?
DrPhil_Guth - 09.01.2007, 21:27
also hoffe dafür gibts in der Bibliothek irgendeine Funktion, die das erledigt.
Wenn nicht, dann können wir uns mit den Offset adressen herumschlagen...
Re: Mp3 Tag lesen ?
exbs - 09.01.2007, 21:50
http://www.vb-fun.de/cgi-bin/loadframe.pl?ID=vb/tipps/tip0106.shtml hier wird beschrieben, wie das in VB 6 geht. evtl lässt sich das ja übertragen.
Re: Mp3 Tag lesen ?
DrPhil_Guth - 09.01.2007, 23:14
Aha, also was ich verstanden habe sind die ID3 Tags immer am Ende der Mp3 Datei. Er ist 128 Bytes groß und beinhaltet alle Daten. Am Anfang des Tags befindet sich das wort "TAG", d.H. wir müssen nur 128 byte (grob genommen zeichen, da sizeof(char) == 1 byte) vor dem Ende der Datei suchen, ob ein Wort namens TAG steht.
Zitat: If you one sum the the size of all these fields we see that 30+30+30+4+30+1 equals 125 bytes and not 128 bytes. The missing three bytes can be found at the very beginning of the tag, before the song title. These three bytes are always "TAG" and is the identification that this is indeed a ID3 tag. The easiest way to find a ID3v1/1.1 tag is to look for the word "TAG" 128 bytes from the end of a file.
Natürlich kann es sein, dass das durch zufall auch passiert, allerdings steht bei wikipedia, dass die ws. nur 0.00006 % beträgt.
Re: Mp3 Tag lesen ?
DrPhil_Guth - 10.01.2007, 22:14
Tja, das sieht zwar recht einfach aus, doch gilt dies allerdings nur für Id3v1.
Kompliziert wirds erst, wenn du zugriff auf Id3v2 willst. Da kann der Tag nämlich beliebig(bis 256 mb) groß sein, mehrere verschiedene Daten enthalten und bezieht sich auch auf Mp3 Frames (keine Ahnung was das ist).
Ich schlag erst mal vor es bei Id3v1 zu belassen.
Ich hab schon ne tolle Idee für eine Klasse, das bedeutet aber C++. Wenn du damit probleme hast, dann kannst du ja die main- datei in C schreiben, ich bieg die Klasse schon so hin, dass man möglichst C- Ähnlich darauf zugreifen kann.
Wär das in ordnung für dich?
Re: Mp3 Tag lesen ?
exbs - 10.01.2007, 22:55
Nja auch wenn es nicht "gut" ist kann man ja c++ code auch in c packen. das würde mich net stören, früher oda später werde ich es eh lernen (müssen). das mit v1 ist richtig, würde auch sagn, dass das reicht ... man soll ja auch leicht beginnen. Was hast du denn für eine idee?
Re: Mp3 Tag lesen ?
DrPhil_Guth - 10.01.2007, 22:58
ehm, man könnte sagen schon eine Ziemlich Konkrete.
Sollte eine Klasse werden, die einen ID3 tag repräsentiert. Sie enthält Methoden zum Lesen und Verändern des Tags.
Der tag selber ist als einfacher ASCII string gespeichert.
Später sollte noch die Möglichkeit dazukommen, dass man den Tag direkt aus der Mp3 Datei liest.
Re: Mp3 Tag lesen ?
DrPhil_Guth - 12.01.2007, 16:30
Sooo, die Klasse wär jetzt mal in nem "Kompilierbaren zustand", obwohl ich mir nicht ganz sicher bin, habs nur mit g++ getestet.
Natürlich ist die nicht fertig und da kommt noch ne ganze menge zeug dazu. Und ich glaube da sind noch ein paar bugs drinnen ... (das mit dem Genre- byte haut noch nicht ganz hin)
aber ich poste sie trotzdem mal
also hier die CID3v1.h:
Code: // CID3v1.h
#include <iostream>
#include <cstring>
#include <string>
#ifndef CID3V1_H
#define CID3V1_H
using namespace std;
class ID3_tag
{
private:
const static int TAGSIZE;
char tag_string[128+1];
public:
//Constants used to acces the tag information
const static unsigned int OFFS_TAG;
const static unsigned int OFFS_TITLE;
const static unsigned int OFFS_ARTIST;
const static unsigned int OFFS_ALBUM;
const static unsigned int OFFS_YEAR;
const static unsigned int OFFS_COMMENT;
const static unsigned int OFFS_GENRE;
//Error codes
const static unsigned int ERR_WRONGOFFS;
// stringtable for the genres
static const char* szGenreTable[81];
// CONSTRUCTOR LIST
//standard constructor
//ID3_tag() {}
/*
* These overloaded functions are used to copy the tag as a string
* to szTargetString.
*
* szTargetString has to be long enough that means
* 128 bytes for the whole tag
* 30 bytes for the title, artist, album and comment
* 4 bytes for the year
* 1 byte for the genre
*
* You can call these functions with flags to access the parts
* of the tag.
* flags can be looked up in CID3v1.cpp
* If called without the constants, the operation applies to the whole tag
*
* Don't try to call them with wrong flags, or they will return
* ID3_tag::ERR_WRONGOFFS
*/
int get_tag(char* szTargetString);
int get_tag(const int offset, char* szTargetString);
int get_tag(string &stringobj);
int get_tag(const int offset, string &stringobj);
/*
* Functions used to write the tag to the object
* same usage as the read functions
* the functions will read a maximum of 128 characters.
*
*/
int write_tag(char* szSourceString);
int write_tag(const int offset, char* szSourceString);
int write_tag(string &stringobj);
int write_tag(const int offset, string &stringobj);
/*
* These functions are used to turn the genre byte into a
* human readable string and vice versa
* The Functions will return a null Pointer if
* the value is not recognized
* genre_byte2string returns szTargetString for success
*/
char* genre_str2byte (char* szGenreString, char* pcTargetByte);
char* genre_byte2string (char* pcGenreByte, char* szTargetString);
/*
* Overloaded stream operator, to make input and output easier
*/
friend ostream& operator<< (ostream& os, ID3_tag& tag);
};
#endif // #ifndef CID3V1_H
Und hier dann die CID3V1.cpp:
Code: //CID3v1.cpp
#ifndef CID3V1_CPP
#define CID3V1_CPP
#include <iostream>
#include <cstring>
#include <string>
#include "CID3v1.h"
//using namespace std;
const int ID3_tag::TAGSIZE = 128;
// constants used to access the tag information
// see http://www.id3.org/ID3v1 for more information
const unsigned int ID3_tag::OFFS_TAG = 0;
const unsigned int ID3_tag::OFFS_TITLE = 3;
const unsigned int ID3_tag::OFFS_ARTIST = 33;
const unsigned int ID3_tag::OFFS_ALBUM = 63;
const unsigned int ID3_tag::OFFS_YEAR = 93;
const unsigned int ID3_tag::OFFS_COMMENT= 97;
const unsigned int ID3_tag::OFFS_GENRE = 127;
//error codes
const unsigned int ID3_tag::ERR_WRONGOFFS = 129;
// Stringtable for the genres:
const char* ID3_tag::szGenreTable[81] =
{
"Blues",
"Classic Rock",
"Country",
"Dance",
"Disco",
"Funk (Musik)",
"Grunge",
"Hip-Hop (Musik)",
"Jazz",
"Metal",
"New Age",
"Oldies",
"Other",
"Pop",
"R&B",
"Rap",
"Reggae",
"Rock",
"Techno",
"Industrial",
"Alternative",
"Ska",
"Death Metal",
"Pranks",
"Soundtrack",
"Euro-Techno",
"Ambient",
"Trip-Hop",
"Vocal",
"Jazz&Funk",
"Fusion",
"Trance",
"Classical",
"Instrumental",
"Acid",
"House",
"Game",
"Sound Clip",
"Gospel",
"Noise",
"Alternative Rock",
"Bass",
"Soul",
"Punk",
"Space",
"Meditative",
"Instrumental Pop",
"Instrumental Rock",
"Ethnic",
"Gothic",
"Darkwave",
"Techno-Industrial",
"Electronic",
"Pop-Folk",
"Eurodance",
"Dream",
"Southern Rock",
"Comedy",
"Cult",
"Gangsta",
"Top 40",
"Christian Rap",
"Pop/Funk",
"Jungle",
"Native US",
"Cabaret",
"New Wave",
"Psychedelic",
"Rave",
"Showtunes",
"Trailer",
"Lo-Fi",
"Tribal",
"Acid Punk",
"Acid Jazz",
"Polka",
"Retro",
"Musical",
"Rock & Roll",
"Hard Rock",
"Folk",
};
//////////////////
//READ FUNCTIONS//
//////////////////
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::get_tag(char* szTargetString)
{
strncpy (szTargetString, tag_string, TAGSIZE);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::get_tag(const int offset, char* szTargetString)
{
int copylength;
switch (offset) {
case OFFS_TAG:
copylength = 3;
break;
case OFFS_TITLE:
case OFFS_ARTIST:
case OFFS_ALBUM:
case OFFS_COMMENT:
copylength = 30;
break;
case OFFS_YEAR:
copylength = 4;
break;
case OFFS_GENRE:
copylength = 1;
break;
default:
return ID3_tag::ERR_WRONGOFFS;
break;
}
strncpy (szTargetString, &tag_string[offset], copylength);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::get_tag (std::string &stringobj)
{
stringobj.assign(tag_string, TAGSIZE);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::get_tag (const int offset, std::string &stringobj)
{
int copylength;
switch (offset) {
case OFFS_TAG:
copylength = 3;
break;
case OFFS_TITLE:
case OFFS_ARTIST:
case OFFS_ALBUM:
case OFFS_COMMENT:
copylength = 30;
break;
case OFFS_YEAR:
copylength = 4;
break;
case OFFS_GENRE:
copylength = 1;
break;
default:
return ID3_tag::ERR_WRONGOFFS;
break;
}
stringobj.assign(&tag_string[offset], copylength);
return 0;
}
/////////////////////
// WRITE FUNCTIONS //
/////////////////////
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::write_tag(char* szSourceString)
{
strncpy (tag_string, szSourceString, TAGSIZE);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::write_tag (const int offset, char* szSourceString)
{
int copylength;
switch (offset) {
case OFFS_TAG:
copylength = 3;
break;
case OFFS_TITLE:
case OFFS_ARTIST:
case OFFS_ALBUM:
case OFFS_COMMENT:
copylength = 30;
break;
case OFFS_YEAR:
copylength = 4;
break;
case OFFS_GENRE:
copylength = 1;
break;
default:
return ID3_tag::ERR_WRONGOFFS;
break;
}
strncpy (&tag_string[offset], szSourceString, copylength);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::write_tag(std::string &stringobj)
{
const char* szSourceString = stringobj.c_str();
strncpy (tag_string, szSourceString, TAGSIZE);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
int ID3_tag::write_tag (const int offset, std::string &stringobj)
{
int copylength;
switch (offset) {
case OFFS_TAG:
copylength = 3;
break;
case OFFS_TITLE:
case OFFS_ARTIST:
case OFFS_ALBUM:
case OFFS_COMMENT:
copylength = 30;
break;
case OFFS_YEAR:
copylength = 4;
break;
case OFFS_GENRE:
copylength = 1;
break;
default:
return ID3_tag::ERR_WRONGOFFS;
break;
}
const char* szSourceString = stringobj.c_str();
strncpy (&tag_string[offset], szSourceString, copylength);
return 0;
}
///////////////////////////////////////////////////////////////////////////////
char* ID3_tag::genre_str2byte (char* szGenreString, char* pcTargetByte)
{
// buffer for the lowercase version of szGenreString
char genre[18];
// buffer for the lowercase version of szGenreTable
char buffer[18];
// loop variables
int i, j;
strncpy (genre, szGenreString, 18);
// turn every character to lowercase
for (i=0; i<18; i++)
genre[i] = tolower (genre[i]);
//check for matching Genre
for (i=0; i<80; i++)
{
strncpy (buffer, szGenreTable[i], 18);
// turn every character to lowercase
for (j=0; j<18; j++)
buffer[j] = tolower (buffer[j]);
if ( strcmp(genre, buffer) == 0)
{
*pcTargetByte = i;
return pcTargetByte;
} // if ( strcmp(genre, buffer) == 0)
memset (buffer, 0, 18);
} // for (i=0; i<80; i++)
return NULL;
}
///////////////////////////////////////////////////////////////////////////////
char* ID3_tag::genre_byte2string (char* pcGenreByte, char* szTargetString)
{
int dGenre;
dGenre = (int) *pcGenreByte;
if (dGenre >= 0 && dGenre <=79) {
strcpy (szTargetString, szGenreTable[dGenre]);
return szTargetString;
}
else {
return NULL;
}
}
///////////////////////////////////////////////////////////////////////////////
std::ostream& operator<< (std::ostream& os, ID3_tag& tag)
{
char buffer[31];
char genre;
tag.get_tag(ID3_tag::OFFS_TITLE, buffer);
os<<"Title:\n"<<buffer<<"\n\n";
memset (buffer, 0, 31);
tag.get_tag(ID3_tag::OFFS_ARTIST, buffer);
os<<"Artist:\n"<<buffer<<"\n\n";
memset (buffer, 0, 31);
tag.get_tag(ID3_tag::OFFS_ALBUM, buffer);
os<<"Album:\n"<<buffer<<"\n\n";
memset (buffer, 0, 31);
tag.get_tag(ID3_tag::OFFS_YEAR, buffer);
os<<"Year:\n"<<buffer<<"\n\n";
memset (buffer, 0, 31);
tag.get_tag(ID3_tag::OFFS_COMMENT, buffer);
os<<"Comment:\n"<<buffer<<"\n\n";
memset (buffer, 0, 31);
tag.get_tag(ID3_tag::OFFS_GENRE, buffer);
genre = *buffer;
tag.genre_byte2string (&genre, buffer);
os<<"Genre:\n"<<buffer<<"\n\n";
return os;
}
#endif // #ifndef CID3V1_CPP
[edit] code upgedatet, allerdings gibts noch ne speicherüberlauf an der gekennzeichneten stelle. Wird in kürze beseitig.
Re: Mp3 Tag lesen ?
DrPhil_Guth - 15.01.2007, 16:44
Fehler gefunden, das problem lag in der Falschen initialisierung des Stringtables. Der code der jetzt dasteht müsste jetzt ungefähr bugfrei sein...
Re: Mp3 Tag lesen ?
DrPhil_Guth - 27.01.2007, 13:31
So, ich denke nach so langer zeit ist wiedermal ein Statusbericht fällig.
Ich hab jetzt noch 3 Funktionen geschrieben:
eine, die erkennt ob eine MP3 datei einen Tag hat,
eine, die den Tag ausliest und
eine, die den Tag schreibt.
So, die ersten beide funktonieren völlig problemlos, die könnte man gleich "As Is" verwenden.
Das problem liegt in der schreibfunktion, die bockt ziemlich.
Ich empfehle, keine dateien die man wirklich braucht damit aufzurufen, denn diese funktion reduziert alles was sie findet auf 128 bytes :-)
Ich poste mal den Quellcode. Ich hab die 3 funktionen extra in eine eigene Datei gepackt, da ich die Klasse nicht verunstalten wollte.
Code: #include<stdio.h>
#include<stdlib.h>
#define DEBUG__
/* GLOBAL VARIABLES AND CONSTANTS ########################################## */
const int TAGSIZE = 128;
const int ERR_NOTAG = 130;
const int ERR_FILE = 131;
#ifdef DEBUG__
static int function_called = 0;
#endif
char tag_string[129];
/* FUNCTION DECLARATIONS ################################################### */
int is_no_tag (FILE* in_file);
int read_file (FILE* in_file);
int write_file (FILE* in_file, int is_tag);
/* FUNCTIONS ############################################################### */
int main(int argc, char** argv)
{
FILE* mp3_file = NULL;
memset(tag_string,'\0', 129);
/* Checking arguments */
if (argc < 2)
exit(0);
/* Open file */
if ( (mp3_file = fopen(argv[1],"rw")) == NULL)
{
printf ("Zeiger: %p\n", mp3_file);
printf ("File %s could not be loaded.\n", argv[1]);
exit(0);
}
/* Checking if there is a tag */
if ( !is_no_tag(mp3_file) )
{
printf ("The file does have an ID3 tag.\n");
}
else
{
printf ("The file does not have an ID3 tag.\n");
exit(0);
}
/* Reading the tag */
int ret_val;
if ( ret_val = read_file(mp3_file) )
{
printf ("File could not be read: %d\n",ret_val);
fclose(mp3_file);
exit(0);
}
/* printing the Tag */
int i;
for (i=0; i<129; i++)
{
if ( tag_string[i] == '\0')
{
putc(' ', stdout);
}
else
{
putc (tag_string[i], stdout);
}
}
printf ("\n");
/* Ask the new tagstring from the user */
printf ("\nPlese enter the tagstring: \n");
char buffer[128];
fgets(buffer, 128, stdin);
sscanf (buffer, "%s", tag_string);
printf ("\nTagstring: %s\n", tag_string);
/* Reopen the File */
if (!freopen(argv[1], "w", mp3_file))
{
printf ("Couldnt be reopened\n");
exit(0);
}
/* Write the new Tagstring to the file */
if (write_file (mp3_file, 1) == ERR_FILE)
{
printf ("couldnt write to the file\n");
exit(0);
}
fclose(mp3_file);
return 0;
}
/*
* in: pointer to a file, opened for reading or read/write
* out: returns 0 if there is a Tag, ID3v1::ERR_FILE if a file error occurs
* ID3v1::NO_TAG if there is no Tag.
*/
int is_no_tag (FILE* in_file)
{
#ifdef DEBUG__
function_called++;
printf ("Entered is_no_tag %d. time.\n", function_called);
#endif
/* checking if everything is allright */
if ( ferror(in_file) != 0)
{
perror("CID3v1::is_no_tag(1)");
return ERR_FILE;
}
/* Get Initial position of the stream position indicator */
fpos_t initial_pos;
fgetpos(in_file, &initial_pos);
/* Set position indicator to assumed position of the TAG */
fseek (in_file, (TAGSIZE) * (-1), SEEK_END);
/* Read into buffer */
char buffer[4];
fread (buffer, sizeof(char), 3, in_file);
buffer[3]='\0';
#ifdef DEBUG__
printf ("buffer: %s\n", buffer);
#endif
/* checking if everything is allright after reading*/
if ( ferror(in_file) != 0)
{
perror("CID3v1::is_no_tag(2)");
return ERR_FILE;
}
/* reset position */
fsetpos(in_file, &initial_pos);
if ( strncmp (buffer, "TAG", 3) == 0)
{
#ifdef DEBUG__
printf ("Tag found (%d)\n", function_called);
#endif
return 0;
}
else
{
#ifdef DEBUG__
printf ("Tag not found (%d)\n", function_called);
#endif
return ERR_NOTAG;
}
} /* int is_no_tag (FILE* in_file) */
/*
* in: pointer to a file, opened for reading or read/write
* out: returns 0 if there is a Tag, ID3v1::ERR_FILE if a file error occurs
* ID3v1::NO_TAG if there is no Tag.
*
* If the function finds a Tag at the end of File, it copies the tag to the
* internal tag buffer.
*/
int read_file(FILE* in_file)
{
#ifdef DEBUG__
printf ("Entered read_file.\n");
#endif
/* checking if everything is allright */
if ( ferror(in_file) != 0)
{
perror("CID3v1::read_file");
return ERR_FILE;
}
/* Checking for presence of Tag */
int err_val = 0;
err_val = is_no_tag(in_file);
if ( err_val )
return err_val;
/* Get Initial position of the stream position indicator */
fpos_t initial_pos;
fgetpos(in_file, &initial_pos);
/* Set position indicator to the position of the TAG */
fseek (in_file, (TAGSIZE) * (-1), SEEK_END);
/* Read into tag_string */
fread (tag_string, sizeof(char), 128, in_file);
/* checking if everything is allright after reading*/
if ( ferror(in_file) != 0)
{
perror("CID3v1::read_file");
return ERR_FILE;
}
/* reset position */
fsetpos(in_file, &initial_pos);
return 0;
}
/*
* in: pointer to a file, opened for writing or reading/writing
* out: returns 0 if there is a Tag, ID3v1::ERR_FILE if a file error occurs
*
* If a tag is present, the tag is overwritten with the tag_string.
* If not, tag_string is appended to the file.
*/
int write_file(FILE* in_file, int is_tag)
{
#ifdef DEBUG__
printf ("Entered write_file.\n", function_called);
#endif
/* checking if everything is allright */
if ( ferror(in_file) != 0)
{
perror("CID3v1::write_file");
return ERR_FILE;
}
/* Get Initial position of the stream position indicator */
fpos_t initial_pos;
fgetpos(in_file, &initial_pos);
/* Clear the streambuffer */
/* fflush (in_file);
*/
if ( is_tag )
{
/* Set position indicator to the position of the TAG */
fseek (in_file, (TAGSIZE) * (-1), SEEK_END);
}
else
{
/* Set position indicator to eof, if no tag is found */
fseek (in_file, 0, SEEK_END);
}
/* Write the Tagstring to the file */
fwrite (tag_string, sizeof(char), 128, in_file);
/* checking if everything is allright after writing*/
if ( ferror(in_file) )
{
perror("CID3v1::write_file");
return ERR_FILE;
}
/* reset position */
fsetpos(in_file, &initial_pos);
return 0;
}
Also, soweit ich das sehe liegt das Problem in manchen dingen:
1. Wie kann ich die funktion is_no_tag() aufrufen, wenn der Dateistream als write geöffnet ist? Ich hab das im moment so gelöst, dass der Benutzer der Funktion einen Wert übergeben muss, ob ein Tag vorhanden ist
2. Wie Krieg ich die Funktion dazu, dass sie nicht alles löscht was 128 kb vor dem Ende der datei liegt? Ich versteh im moment nicht wieso sie das überhaupt tut...
Kann mir vielleicht jemand helfen, ich blick irgendwie überhaupt nicht durch, wie ichs richtig hinkriege.
mfg, DrPhil_Guth
[edit]
Juhuuu! Den fehler hab ich gefunden, man muss den stream nur richtig öffnen. ("ab+" als flag für fopen())
Tja, jetzt funktionierts im grunde, nur dass der tag immer angehängt wird. Aber das krieg ich noch hin.
[edit2]
So, jetzt funktioniert es ganz. Und es war wieder das falsche flag... Jetzt ein für alle mal: das richtige ist rb+....
Die funktionen sind auch schon in die Klasse eingebaut.
Nach ein paar verbesserungen an der Lesbarkeit, ein paar Kommentaren und nachdem ich ein paar bugs rausgebracht habe, geht die erste version online.
Mit folgendem Code, können Sie den Beitrag ganz bequem auf ihrer Homepage verlinken
Weitere Beiträge aus dem Forum Tutorials.at
Quelltext ziemlich lang!? - gepostet von Mr_A_ am Sonntag 15.04.2007
Javascript und Java - gepostet von Jack O'Neill am Dienstag 14.08.2007
Programm (C) was Sekunden in Tage Stunden Minuten umrechnet! - gepostet von Kimi am Donnerstag 01.11.2007
Ein Programm um eine Nachricht zu versenden? - gepostet von niGGo am Dienstag 27.03.2007
C++: Keine neue Seite möglich (mit \f). Wie? - gepostet von Meik1988 am Sonntag 23.07.2006
Bilder - gepostet von BASIC am Mittwoch 31.05.2006
TutorialSammlung für FAQ - gepostet von AQE89 am Montag 30.04.2007
Brauche Headerdatei graphics.h - gepostet von mitti am Freitag 18.05.2007
Ähnliche Beiträge wie "Mp3 Tag lesen ?"
MP3/MP4 Videoplayer - Raider (Samstag 10.11.2007)
Regeln vorher lesen!!! - king gollum (Mittwoch 07.03.2007)
27. Tag Abend - Fiona Webb (Mittwoch 18.07.2007)
Letzter Tag mit meiner Süßen!! - Anna (Dienstag 20.06.2006)
mp3 Klingeltöne - Sammelthread - onkel86 (Sonntag 04.09.2005)
Waterloo at 'Aktuelle Schaubude' - complete - hamlet3 (Montag 08.09.2008)
HMC sagt Guten Tag - HMC (Sonntag 07.10.2007)
Neuer Tag - anna92 (Donnerstag 13.07.2006)
Vor dem Bewerbung schreiben bitte lesen ! - terminatoa1 (Sonntag 23.04.2006)
WICHTIG! BITTE LESEN! - Maerty (Donnerstag 17.01.2008)
