@node nncp-file @section nncp-file @example $ nncp-file [options] [-chunked INT] SRC NODE:[DST] $ nncp-file [options] [-chunked INT] SRC area:AREA:[DST] @end example Send @file{SRC} file to remote @option{NODE}. @file{DST} specifies destination file name in remote's @ref{CfgIncoming, incoming} directory. If this file already exists there, then counter will be appended to it. This command queues file in @ref{Spool, spool} directory immediately (through the temporary file of course) -- so pay attention that sending 2 GiB file will create 2 GiB outbound encrypted packet. @anchor{StdinTmpFile} If @file{SRC} equals to @file{-}, then create an encrypted temporary file and copy everything taken from @code{stdin} to it and use for outbound packet creation. Pay attention that if you want to send 1 GiB of data taken from @code{stdin}, then you have to have more than 2 GiB of disk space for that temporary file and resulting encrypted packet. You can control temporary file location directory with @env{TMPDIR} environment variable. Encryption is performed in AEAD mode with @url{https://cr.yp.to/chacha.html, ChaCha20}-@url{https://en.wikipedia.org/wiki/Poly1305, Poly1305} algorithms. Data is divided on 128 KiB blocks. Each block is encrypted with increasing nonce counter. File is deletes immediately after creation, so even if program crashes -- disk space will be reclaimed, no need in cleaning it up later. If @file{SRC} points to directory, then @url{https://pubs.opengroup.org/onlinepubs/9699919799/utilities/pax.html#tag_20_92_13_01, pax archive} will be created on the fly with directory contents and destination filename @file{.tar} appended. It @strong{won't} contain any entities metainformation, but modification time with the names. UID/GID are set to zero. Directories have 777 permissions, files have 666, for being friendly with @command{umask}. Also each entity will have comment like @verb{|Autogenerated by NNCP version X.Y.Z built with goXXX|}. If @option{-chunked} is specified, then source file will be split @ref{Chunked, on chunks}. @option{INT} is the desired chunk size in KiBs. This mode is more CPU hungry. Pay attention that chunk is saved in spool directory immediately and it is not deleted if any error occurs. @option{-minsize} option is applied per each chunk. Do not forget about @ref{ChunkedZFS, possible} ZFS deduplication issues. Zero @option{-chunked} disables chunked transmission. If @ref{CfgNotify, notification} is enabled on the remote side for file transmissions, then it will sent simple letter after successful file receiving. If you use @option{area:AREA} instead of @option{NODE}, then @ref{Multicast, multicast} packet will be sent to specified area. That creates outgoing packet to the @strong{self} node, so you have to run @ref{nncp-toss, tossing} to create outgoing packets to required subscribers.