English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 11 September 2021, 18:16   #1
Warty
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.
and

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.
I'm not seeing ANYTHING in the buffer there for the ed_Comment, and I'm using ED_COMMENT as the tag.

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 looked at the buffer, and there is no string there (BSTR or otherwise).

(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 */
};
?? what does that mean? A reference to ed_Comment being a BSTR perhaps?

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 */
};
and

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?
Warty is offline  
Old 11 September 2021, 18:37   #2
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 3,214
Quote:
Originally Posted by Warty View Post
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. 3.2 gurus... any chance of a GetComment function in 3.2.1?
No, because you already have one. (-: Check , in particular "struct FileInfoBlock", and dos/Examine(), dos/ExNext() which will fill out this structure.
Thomas Richter is offline  
Old 11 September 2021, 19:59   #3
Warty
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().
Warty 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
"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

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 11:27.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10336 seconds with 13 queries