View Single Post
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  
 
Page generated in 0.04903 seconds with 11 queries