CosFileTra...leIterator(3)

πŸ“¦
version 5.2.2 Β· 2 versions
, in fedora 43, fedora 44

πŸ’… CosFileTra...leIterator β€” the Erlang module page, bestie edition

ok so you're looking at CosFileTra...leIterator(3), and yes the name got truncated by the man page formatter, we don't talk about that πŸ’€. This is an Erlang module definition page, and the module in question is CosFileTransfer_FileIterator. She's a real one, she's part of the OMG world. iykyk. 🌸


✨ NAME ✨

CosFileTransfer_FileIterator β€” okay so literally, this module implements the OMG CosFileTransfer::FileIterator interface. That's it, that's the job, and she does it flawlessly. πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

Bestie, listen. To get access to the record definitions for the structures, you use:

-include_lib("cosFileTransfer/include/*.hrl").

no cap, that's the whole vibe. Include it or you're just out here raw-dogging structs and we do NOT do that. πŸ’–


🌈 EXPORTS 🌈

okay here come the main characters, one by one, slay by slay ✨

πŸŽ€ next_one(Iterator) -> Return

Types:

Iterator = #objref
Return = {boolean(), #'CosFileTransfer_FileWrapper'{the_file = File file_type = Type}}
File = #objref
Type = nfile | ndirectory

So this operation is giving peek-at-the-current-spot energy. It returns true if a FileWrapper exists at the current position, and in that case the out parameter contains a valid File reference. Obsessed. 🫢

But if it returns false, the out parameter is a non-valid FileWrapper β€” like, don't trust it, it's not your friend, it's a ghost. πŸ‘» Keep that in mind or you WILL get humbled.


🧚 next_n(Iterator, Max) -> Return

Types:

Iterator = #objref
Max = unsigned long()
Return = {boolean(), FileList}
FileList = [#'CosFileTransfer_FileWrapper'{the_file = File file_type = Type}]
File = #objref
Type = nfile | ndirectory

This one is the bulk order version, periodt. It returns true if the requested number of FileWrappers can be delivered and there are additional FileWrappers still chillin' after that. πŸ”₯

If false is returned, you get a list β€” of length Max or less β€” containing the last valid FileWrappers associated with the target object. So it's not empty, it's not broken, it's just the leftovers and honestly? iconic. πŸ’œ


πŸ’€ destroy(Iterator) -> ok

Types:

Iterator = #objref

This operation terminates the target object. That's it. She said bye, she meant bye, the door is closed, no notes. πŸ’…βœ¨


⚠️ quick vibe check: next_one can hand you a non-valid FileWrapper when it returns false, so always check that boolean before you go using the out parameter. fr fr. πŸ™ˆ

and that's the whole page bestie, you ate it, you understood it, you're basically a distributed systems girlie now πŸ’–

this page came to you from Ericsson AB, covering cosFileTransfer 5.2.2 β€” so if you ever need to cite your sources, that's the tea, mwah πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from