2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
5 Desc: Set a filecomment.
9 #include <aros/debug.h>
10 #include <proto/exec.h>
11 #include <dos/dosextens.h>
13 #include <proto/dos.h>
14 #include "dos_intern.h"
16 /*****************************************************************************
19 #include <proto/dos.h>
21 AROS_LH2(LONG
, SetComment
,
24 AROS_LHA(CONST_STRPTR
, name
, D1
),
25 AROS_LHA(CONST_STRPTR
, comment
, D2
),
28 struct DosLibrary
*, DOSBase
, 30, Dos
)
31 Change the comment on a file or directory. The comment may be any
32 NUL-terminated string. The supported size varies from filesystem
33 to filesystem. In order to clear an existing comment, an empty
34 string should be specified.
37 name - name of the file
38 comment - new comment for the file.
41 Boolean success indicator. IoErr() gives additional information upon
54 *****************************************************************************/
58 struct PacketHelperStruct phs
;
59 LONG status
= DOSFALSE
;
61 D(bug("[SetComment] '%s' '%s'\n", name
, comment
));
62 if (strlen(comment
)>MAXCOMMENTLENGTH
)
64 SetIoErr(ERROR_COMMENT_TOO_BIG
);
67 if (getpacketinfo(DOSBase
, name
, &phs
)) {
68 BSTR com
= C2BSTR(comment
);
70 status
= dopacket4(DOSBase
, NULL
, phs
.port
, ACTION_SET_COMMENT
, (SIPTR
)NULL
, phs
.lock
, phs
.name
, com
);
73 SetIoErr(ERROR_NO_FREE_STORE
);
75 freepacketinfo(DOSBase
, &phs
);