CompuServe Thread

#FileComment?

4 messages in this thread
#39131From: Andre LackmannJan 25, 1994 4:53 AM
Hi All! I'm wondering how I can manipulate the filecomment of a file? There doesn't seem to be a function in Lattice C to do such a thing. Does anyone have some example code or have any pointers that could help me?? I'm a bit of a novice when it comes to 'C' so bear with me! Thanks in Advance, Regards, Andre Lackmann On AutoPilot and still outta control
#39146From: Peter WadeJan 25, 1994 3:45 PM
I have not tried this myself, but according to the AmigaDOS manual there is a function called SetComment which will set the comment on a file or directory. To read the comment I believe you have to either Open the file (using the AmigaDOS "Open", not SAS "open") and use ExamineFH to get a FileInfoBlock struct, or get a lock on the file and use Examine. The FileInfoBlock has a field called fib_Comment which is a null terminated string. The functions are : int SetComment ( char *name, char *comment ) ; int Examine ( BPTR lock, struct FileInfoBlock *fb ) ; int ExamineFH ( BTPR filehandle, struct FileInfoBlock *fb ) ; All the functions return TRUE if they succeed. Hope this is of help Peter Wade Autopiloting from London, England
#39147From: Steve AhlstromJan 25, 1994 5:28 PM
SetComment( STRPTR name, STRPTR comment ) -sja
#39164From: John Toebes/SYSOPJan 26, 1994 8:02 PM
You will want to use the SetComment function: rc = SetComment("File", "This is the new comment string"); BION (Believe It Or Not) it is actually that simple. Make sure that dos.library is already open before you do this (it is automatically opened by the startup, so unless you do something funny/special this isn't an issue). Enjoy.