11 September 2021, 18:16 | #1 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Getting "Comment" from an Info File (3.2?)
I'm trying to read the comment from an info file, and display it to the user. I am programming in C, against the 3.2 NDK.
I would prefer not have have to resort to using AREXX or doing an AmigaDOS command and parsing the result. (slow, complicated, etc.) I think, based on testing to date, that it's impossible, but I am hoping someone can confirm that. Here's what I think is reality: - DOSlibrary has a SetComment function, but no GetComment http://amigadev.elowar.com/read/ADCD.../node01B2.html - The ExAll function looks like it should be able to read comments, but it doesn't appear to actually do it. http://amigadev.elowar.com/read/ADCD.../node015A.html Code:
ED_COMMENT Comment (will be NULL if no comment) Note: the V37 ROM/disk filesystem returns this incorrectly as a BSTR. See BUGS for a workaround. Code:
The V37 ROM/disk filesystem doesn't fill in the comment field correctly if you specify ED_OWNER. See BUGS for a workaround if you need to use ED_OWNER. Code:
The V37 ROM/disk filesystem incorrectly returned comments as BSTR's (length plus characters) instead of CSTR's (null-terminated). See the next bug for a way to determine if the filesystem is a V37 ROM/disk filesystem. Fixed in V39. (I confirmed my test file has a comment in the info file). Then, from dos/exall.h: http://amigadev.elowar.com/read/ADCD.../node0079.html Code:
struct ExAllData { struct ExAllData *ed_Next; UBYTE *ed_Name; LONG ed_Type; ULONG ed_Size; ULONG ed_Prot; ULONG ed_Days; ULONG ed_Mins; ULONG ed_Ticks; UBYTE *ed_Comment; /* strings will be after last used field */ }; and from this AmigaMail: http://amigadev.elowar.com/read/ADCD.../node006E.html Code:
struct ExAllData { struct ExAllData *ed_Next; /* Pointer to the next structure */ UBYTE *ed_Name; /* File name */ LONG ed_Type; /* File type */ ULONG ed_Size; /* File size */ ULONG ed_Prot; /* Protection bits (FIBF_ definitions in <dos/dos.h> */ ULONG ed_Days; /* Date in three longwords, forming a DateStamp. */ ULONG ed_Mins; ULONG ed_Ticks; UBYTE *ed_Comment; /* File comment. Cannot be used */ }; Code:
ED_NAME - ed_Name - file name ED_TYPE - ed_Type - file type (directory, file, soft link, etc.) ED_SIZE - ed_Size - file size ED_PROTECTION - ed_Prot - file protection bits ED_DATE - ed_Days, ed_Mins, ed_Ticks - file date in long words ED_COMMENT - ed_Comment - file comment (not currently supported). Any wisdom? 3.2 gurus... any chance of a GetComment function in 3.2.1? |
11 September 2021, 18:37 | #2 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,215
|
No, because you already have one. (-: Check , in particular "struct FileInfoBlock", and dos/Examine(), dos/ExNext() which will fill out this structure.
|
11 September 2021, 19:59 | #3 |
Registered User
Join Date: Aug 2018
Location: Minneapolis, USA
Posts: 301
|
Thanks Thomas!
I saw the "see also" pointing to "Examine()" and my brain saw "ExAll" and followed that path. The other thing I did wrong here, which I didn't realize until I tested the FIB route and was still getting empty comments, was that I thought the DOSlib wanted the path to the INFO file, not the path to the parent (non-.info) file. Once I started passing the non-.info path, it filled out. So the ed_Comment route also works fine, if you happen to be doing ExAll instead of Examine(). |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Diabolik" & "Dylan Dog" & "Tex" & "Time Runners" series | DamienD | request.Old Rare Games | 20 | 21 July 2022 16:58 |
"Voices8" 8 Channel Soundtracker "DemoSongI" song - "This is the Amiga with 8 Voices" | DemosongIHunter | request.Music | 45 | 23 May 2022 20:07 |
Info "Cd-Rom" connect to uaescsi.device | Zilog | support.WinUAE | 6 | 30 August 2018 19:12 |
Cli program to "execute" .info files | olesio | support.Apps | 4 | 05 September 2010 19:19 |
Search info about a strange game called "Roboter" | Daff | request.Old Rare Games | 3 | 01 September 2007 20:09 |
|
|