#define LIST "dir"
VOID getListing( linebufferptr head , char currentdirectory[ 256 ] )
{
linebufferptr current;
linebufferptr temp ;
FILE* fp;
fp=NULL;
system( "dir /b > dirlist.txt" );
fp = fopen( "dirlist.txt" , "r");
if( fp == NULL )
{ printf("\nfopen error\n");
exit(1);
}
current = head;
do{
temp = addToListEnd( current );
current ->next = temp ;
current = temp;
}while ( fgets( temp->line , sizeof( temp->line ) , fp ) ) ;
fclose( fp );
system( "del dirlist.txt" );
}/* end function getListing() */
/*
fp = tmpfile( );
but how to redirect system into tempfile?
fp = fopen( TEMPFILENAME , "r");
*/