Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.pascal.borland    |    Borland Pascal was actually pretty neat    |    2,978 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,395 of 2,978    |
|    Femme Verbeek to nobody    |
|    Re: input Volume-Name - output drive-num    |
|    26 Feb 07 11:20:56    |
   
   From: fv@nospam.tcenl.com   
      
   nobody schreef:   
   > Hallo experts,   
   >   
   > do you know a simple way how to get the valid hard-disk-number ($80,   
   > $81 . . . } for a given Volume-name ( C:\, D:\ ,E:\ . . .)   
   > or could you tell me where to find this kind of information?   
   > ( working with BP7 & Freepascal )   
   > thank you very much + regards   
   > Robert   
      
   This code predates Windows. Except a wrong value of diskfree on modern   
   very large harddisks, never had any problems with it.   
   Paramstr[0] is the path + name of the running executable.   
      
   -- Femme   
      
      
   Uses dos;   
   var   
    N: NameStr;   
    E,nn: ExtStr;   
    Drivenr:integer;   
    Directory:dirstr;   
   begin   
    FSplit(Fexpand(Paramstr(0)), directory, N, E);   
    WriteLn(directory,N,E);   
    if directory[1] in ['A'..'Z'] then drivenr:=ord(directory[1])-64   
    else drivenr:=0;   
    WriteLn('Available diskspace ', diskfree(drivenr));   
    If fexpand('')<>directory then   
    WriteLn('Default DOS directory= ',fexpand(''),   
    ' Programdirectory= ',directory );   
   end.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca