Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 242
  • Last Modified:

read cd drive information in c

I am working on Turbo c.I have to read the volume name of a CD in c.I have tried the system() function.It does not seem to work.Could someone help?Thanks.
0
suinmess
Asked:
suinmess
1 Solution
 
KocilCommented:
#include <stdio.h>
#include <dir.h>
#include <dos.h>

#define CDDRIVE "F:"

int main(void)
{
  struct ffblk ff;
  int result;

  result=findfirst(CDDRIVE"\*.*",&ff,FA_LABEL);
  if (result == 0) printf("CD NAME : %s\n",ff.ff_name);
  else printf("CD NONAME\n");
}
0
 
jmcgOwnerCommented:
Nothing has happened on this question in more than 10 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by Kocil.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now