DDEST(n)
π transfer::data::destination(n) β the data destination glow-up π
okay bestie, listen. this is a Tcl manpage from the tcllib family, and it's all about where the data goes. no cap. it lives in the transfer module and its whole thing is describing a destination for a data transfer β and also being able to kick off receiving info from a channel into that destination. iconic behaviour honestly. π
β¨ NAME β¨
transfer::data::destination β Data destination π
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require snit ?1.0?
package require transfer::data::destination ?0.3?
transfer::data::destination objectName ?options...?
objectName method ?arg arg ...?
objectName destroy
objectName put chunk
objectName done
objectName valid msgvar
objectName receive channel done
β¨ DESCRIPTION β¨
so this package hands you objects whose main character energy is describing the destination of a data transfer. π¦
and they don't just sit there looking pretty β they can also initiate the reception of information from a channel straight into the destination they're describing. multitasking queen. π
β¨ API β¨
πΈ transfer::data::destination objectName ?options...?
this command makes you a brand-new data destination object, and that object comes with its own associated Tcl command whose name is objectName. π«
that object command gets explained in full detail down in Object command and Object methods (below, bestie, keep scrolling). and the whole set of supported options is explained in Options. π«Ά
quick note on naming: the object command gets created under the current namespace if objectName isn't fully qualified β and in the specified namespace otherwise. the fully qualified name of the object command is what you get back as the result of the command. π
π OBJECT COMMAND
every single object created by the ::transfer::data::destination command has this same general form:
objectName method ?arg arg ...?
the method method plus its arg'uments decide the exact behaviour of the command. for the detailed specs, go read Object methods. it's giving delegation. π
π OBJECT METHODS
π objectName destroy
this method destroys the object. periodt.
β οΈ but be careful bestie: doing this while the object is busy receiving information from a channel will cause errors later on β specifically when the reception completes and tries to access the now-missing data structures of the destroyed object. it's giving haunted. π
π objectName put chunk
the main receptor method. it saves the received chunk of data into the configured destination.
you have to call it for each piece of data received. every single one. no skipping. β¨
π objectName done
the secondary receptor method. it finalizes the receiver, and you have to call it when the receiving channel signals EOF.
after that? neither itself nor put can be called anymore. it's over, it's done, no take-backs. π
π objectName valid msgvar
this method checks the configuration of the object for validity. π΅οΈβοΈ
it returns a boolean flag as its result:
Trueif the object is valid πFalseotherwise π
in that False case, the variable whose name is stored in msgvar gets set to an error message describing the problem it found with the configuration. otherwise, that variable is not touched β hands off, respectfully. β
π¦ objectName receive channel done
this method initiates the reception of data from the specified channel. the received data gets stored into the configured destination, via calls to the methods put and done. π₯
when the reception completes, the command prefix done is invoked β with the number of received characters appended to it as the sole additional argument. that's it, that's the whole payload. π
β¨ OPTIONS β¨
all data destinations support the options listed below. π
important vibe check: all of these are semi-exclusive β each one specifies a different type of destination plus its associated info. and if you specify these options more than once, then the last option specified is the one used to actually configure the object. last one wins, always. π
-channel handleβ this option says the destination of the data is a channel, and its associated argument is the handle of the channel to write the received data to. π-file pathβ this option says the destination of the data is a file, and its associated argument is the path of the file to write the received data to. π-variable varnameβ this option says the destination of the data is a variable, and its associated argument contains the name of the variable to write the received data to. the variable is assumed to be global or namespaced, anchored at the global namespace. π¦-progress commandβ this option, if specified, defines a command to be invoked for each chunk of bytes received, letting you monitor the progress of the reception of the data. the callback is always invoked with one additional argument: the number of bytes received so far. progress bar era. π
β¨ BUGS, IDEAS, FEEDBACK β¨
ngl, this document and the package it describes will undoubtedly contain bugs and other problems. π that's just how it is. please report them in the category transfer of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. and please also report any ideas for enhancements you have for either the package and/or the documentation. we love a glow-up suggestion. π
when proposing code changes, please provide unified diffs, i.e. the output of diff -u. π«Ά
also note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. iykyk. π
β¨ KEYWORDS β¨
channel, copy, data destination, transfer π
β¨ CATEGORY β¨
Transfer module π
β¨ COPYRIGHT β¨
Copyright (c) 2006-2009 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page bestie!! π this one's from tcllib, version 0.3, and it's the transfer::...destination(n) page β she's a legend, she's a queen, she's a data destination. mwah, go forth and receive responsibly. πβ¨π¦
π¦ where this page comes from
- fedora 43: tcllib 2.0-3.fc43 Β· TCL
- fedora 44: tcllib 2.0-4.fc44 Β· TCL
- nixos 26.05: tcllib 2.0
- nixpkgs unstable: tcllib 2.0
- Copyright (c) 2006-2009 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms