TTDT_FILE_NOTICE(3)

πŸ“¦
version 2.5.3 Β· 2 versions
, in nixos 26.05

πŸ’– ttdt_file_notice β€” the file-notice-maker ✨

okay so bestie, you're in the tttk library call section and this little function is your go-to for making and yeeting standard ToolTalk notices about a file πŸ’…


🌸 NAME 🌸

ttdt_file_notice β€” create and send a standard ToolTalk notice about a file. that's it, that's the whole vibe πŸŽ€


✨ SYNOPSIS ✨

#include &<Tt/tttk.h>
Tt_message ttdt_file_notice(
Tt_message context,
Tttk_op op,
Tt_scope scope,
const char *pathname,
int send_and_destroy);

πŸ¦‹ DESCRIPTION πŸ¦‹

so ttdt_file_notice is the function that creates β€” and if you want, also sends β€” any of the standard file notices. the whole squad is here: Created, Deleted, Moved, Reverted, Saved, and Modified. all six, no cap 🫢

it builds a notice with the op and scope you hand it, and sets its file attribute to pathname. then, per the Desktop messaging conventions (iykyk), it adds an unset argument of Tt_mode TT_IN and vtype File to the notice. iconic behavior honestly.

now the fun part: if send_and_destroy is True, it sends the message and then destroys it. if not, it only creates the message. that's the whole toggle πŸ”₯

the context argument is the environment to use. if context is not zero, messages created by ttdt_file_notice inherit from context all contexts whose slotname begins with the characters ENV_. she's copying the environment vibes, periodt.


πŸ‘‘ RETURN VALUE πŸ‘‘

if send_and_destroy is False, you get back the created Tt_message. if send_and_destroy is True, it returns zero; otherwise, it returns an error pointer 😭

the application can use tt_ptr_error(3) to extract one of the following Tt_status values from the returned handle:

  • TT_DESKTOP_EINVAL β€” the op argument was TTDT_MOVED and send_and_destroy was True. yeah, that combo isn't it πŸ’€
  • TT_ERR_DBAVAIL β€” the ToolTalk service could not access the ToolTalk database needed for this operation.
  • TT_ERR_DBEXIST β€” the ToolTalk service could not access the specified ToolTalk database in the expected place.
  • TT_ERR_NOMEM β€” there is insufficient memory available to perform the function. she's out of brain cells, relatable πŸ₯²
  • TT_ERR_NOMP β€” the ttsession(1) process is not running and the ToolTalk service cannot restart it.
  • TT_ERR_OVERFLOW β€” the ToolTalk service has more active messages than it can handle. (the maximum number of active messages is implementation specific, but is at least 2000.) she's at capacity, bestie πŸ™ˆ
  • TT_ERR_POINTER β€” the pathname argument was NULL or was a ToolTalk error pointer.
  • TT_ERR_PROCID β€” the specified process identifier is out of date or invalid.

🌈 APPLICATION USAGE 🌈

okay real talk: ttdt_file_event is the higher-level interface than ttdt_file_notice, and it's the preferred way to send all but the Moved notice. so like... use that one unless you're doing the Moved thing. main character energy for ttdt_file_event, fr fr ⭐


πŸ’œ SEE ALSO πŸ’œ


🧚 and that's the tea, bestie β€” go forth and make notices ✨

and we're out! that was ttdt_file_notice from the library call manual section β€” the original footer just circles back to the same ttdt_file_notice(library call) line with no extra source, version, or date info attached, so consider this your cute little sign-off instead πŸ’–πŸŽ€

πŸ“¦ where this page comes from