Nп/п : 15 из 47
 От   : Oliver Schmidt                      2:5075/128        10 авг 23 20:08:01
 К    : Colin Leroy-Mira                                      10 авг 23 23:10:01
 Тема : Re: cc65: file I/O on external drive?
----------------------------------------------------------------------------------
                                                                                 
@MSGID: 1@solani.org> 494526d0
@REPLY: <20230810182225.7571b259@laptop-sigfox>
0afddc60
@REPLYADDR Oliver Schmidt <ol.sc@web.de>
@REPLYTO 2:5075/128 Oliver Schmidt
@CHRS: CP866 2
@RFC: 1 0
@RFC-Message-ID: 1@solani.org>
@RFC-References: <20230810153128.037b45e2@laptop-sigfox>
<mmphosis-1691679708@macgui.com> <20230810180315.19b34c79@laptop-sigfox>
<20230810182225.7571b259@laptop-sigfox>
@TZUTC: 0000
@TID: FIDOGATE-5.12-ge4e8b94
Hi Colin,

>This is in fact extremely easy: you just fopen("/PREFIX/FILENAME") and
>it finds the correct drive all by itself :)

Yes, ProDOS is about volumes and paths, not about slots and drives.

However, if you have to access a certain drive then the way to do it
is this:

1. Calculate the device number according to the formula
device = slot + (drive - 1) * 8
(https://cc65.github.io/doc/apple2.html#ss9)

2. Call getdevicedir() with the device from 1.
(https://cc65.github.io/doc/funcref.html#ss3.135)

3. Construct an absolute path from 2. or call chdir() with 2.

If you want to return where you`ve been before calling chdir(), you
can call getcwd() before chdir().

In general, you might want to have a look at
https://github.com/cc65/cc65/blob/master/samples/enumdevdir.c

Regards,
Oliver
--- Forte Free Agent 1.21/32.243
 * Origin: usenet.network (2:5075/128)
SEEN-BY: 5001/100 5005/49 5015/255 5019/40 5020/715
848 1042 4441 12000
SEEN-BY: 5030/49 1081 5075/128
@PATH: 5075/128 5020/1042 4441



   GoldED+ VK   │                                                 │   09:55:30    
                                                                                
В этой области больше нет сообщений.

Остаться здесь
Перейти к списку сообщений
Перейти к списку эх