English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 27 December 2015, 23:21   #1
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,066
drive label to device name

Hi,

I'm a bit lazy but I'd like to get the device name (ex: CD0 for a given path:
(ex: Games:mygame)

(i.e. convert Games: to CD0

thanks
jotd is offline  
Old 28 December 2015, 09:08   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 45
Posts: 23,797
One possible solution (Not necessarily the best but quite simple):

lock = Lock("<your path>",SHARED_LOCK), get lock->fl_Task (struct FileLock), then scan DosList for entry with dol_type==DLT_DEVICE with matching dol_task. dol_Name points to device name.
Toni Wilen is online now  
Old 28 December 2015, 12:37   #3
Mrs Beanbag
Glastonbridge Software
Mrs Beanbag's Avatar
 
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,202
just out of interest, why do you actually want to do this?
Mrs Beanbag is offline  
Old 28 December 2015, 14:26   #4
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,066
just to check if the path is located in CD0: drive, because only CD0: drive is readable with the RN CD32 load routine.
jotd is offline  
Old 28 December 2015, 15:16   #5
thomas
Registered User
thomas's Avatar
 
Join Date: Jan 2002
Location: Germany
Posts: 5,998
Quote:
Originally Posted by jotd View Post
just to check if the path is located in CD0: drive, because only CD0: drive is readable with the RN CD32 load routine.
Use this:

file_lock = Lock("Games:mygame",SHARED_LOCK);
cd_lock = Lock("CD0:",SHARED_LOCK);
result = SameLock(file_lock,cd_lock);

if result is LOCK_SAME_VOLUME, then the game directory is on the CD.
thomas is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dopus 4 disk label videofx request.Other 2 08 June 2014 02:00
How to find Exec device name and unit number for boot drive mark_k Coders. System 3 16 February 2013 19:52
How do I change Hard Drive device ID # barney support.Hardware 18 25 August 2009 00:23
Slim CD drive with idefix97.....atapi device appears not to be working Smiley support.Hardware 9 28 April 2007 19:03
MFM.DEVICE problem with escom floppy drive??? CFOU! support.Hardware 7 22 May 2006 00:22

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06583 seconds with 15 queries