#include #include #include ... BPTR lock = NULL; //Lock auf das Laufwerk struct InfoData infodata; //Informationen des Laufwerks STRPTR name = NULL; //z.B.: "DH0:" int bytes = 0; //z.B.: 500 ... if((lock=Lock(name,SHARED_LOCK))!=NULL) //Versucht einen Zugriff auf das Laufwerk { if(Info(lock,&infodata)) //Holt die Laufwerksinformationen { //Freie Bytes: //(infodata.id_NumBlocks-infodata.id_NumBlocksUsed)*infodata.id_BytesPerBlock; //Bytes pro Block: //infodata.id_BytesPerBlock //Benötigte Blöcke: //(bytes/infodata.id_BytesPerBlock)+1 //Abfrage ob genug Blöcke frei sind if( ((bytes/infodata.id_BytesPerBlock)+1) <= (infodata.id_NumBlocks-infodata.id_NumBlocksUsed)) { //Platz reicht aus } } UnLock(lock); //Laufwerk freigeben }