COSFILETRANSFER_FILETRANSFERSESSION(3erl)
π CosFileTransfer_FileTransferSession β the Erlang module page, bestie edition β¨
okay so real quick, the manual-name situation: this is CosFileTra...sferSession(3) from the Erlang Module Definition crew β yeah the title got truncated by the man-page renderer, it's giving "my name is too long for the terminal", iconic behavior honestly. It lives in cosFileTransfer, section 3erl. Let's go π¦
πΈ NAME πΈ
CosFileTransfer_FileTransferSession β this module implements the OMG CosFileTransfer::FileTransferSession interface. periodt. that's the whole assignment. π
β¨ DESCRIPTION β¨
so like. to get access to the record definitions for the structures, use this:
-include_lib("cosFileTransfer/include/*.hrl").
that's it, that's the vibe. include it and you're in. π
π EXPORTS π
'_get_protocols_supported'(FTS) -> Return
Types:
FTS = #objref
Return =
[#'CosFileTransfer_ProtocolSupport'{protocol_name=Type,
addresses=[Address]}]
Type = Address = string()
this is a read only attribute (so no, you cannot touch, do not try to set it, it's not that kind of attribute) and it returns the protocols supported by the target object. list of protocol supports, each one with a protocol_name and a bunch of addresses. slay. π
set_directory(FTS, Directory) -> Return
Types:
FTS = Directory = #objref
Return = ok | {'EXCEPTION, E}
invoking this operation changes the current working directory of the target object's associated file system. basically cd but make it CORBA π
and if it fails to do so, the appropriate exception gets raised. no silent failure, we don't do that here. π
create_file(FTS, FileNameList) -> Return
Types:
FTS = #objref
FileNameList = [string()]
Return = File | {'EXCEPTION, E}
File = #objref
this operation creates a File Object representing a file which may or may not exist. yes bestie, it can represent a file that isn't even there yet, it's manifesting π§ and for this operation to be independent of the working directory, the supplied FileNameList must represent the absolute name. absolute. not relative. we said what we said. β
create_directory(FTS, FileNameList) -> Return
Types:
FTS = #objref
FileNameList = [string()]
Return = Directory | {'EXCEPTION, E}
Directory = #objref
this operation creates a new directory in the target object's associated file system's domain. if it fails to do so, an exception is raised β but if it's successful, a Directory object representing the new directory is returned. so you get a lil object back. a souvenir. a trophy. π
get_file(FTS, FileNameList) -> Return
Types:
FTS = #objref
FileNameList = [string()]
Return = FileWrapper | {'EXCEPTION', E}
FileWrapper = #'CosFileTransfer_FileWrapper'{the_file = File
file_type = Type}
File = #objref
Type = nfile | ndirectory
this operation creates a FileWrapper which represents a file or directory, and it should be independent of the working Directory β i.e., a full path name must be supplied. furthermore, the file or directory represented by the FileNameList must exist. yes, this one actually has to exist, unlike create_file which is out here representing hypotheticals. π and note the file_type is either nfile or ndirectory. those are the only two options, don't come up with a third. π
delete(FTS, File) -> Return
Types:
FTS = File = #objref
Return = ok | {'EXCEPTION', E}
this operation removes the file or directory, represented by the File object, from the target object's associated file system. β οΈ if it is a non-empty directory, or a non-existing file or directory, an exception is raised. so like... it's picky. it will not delete your non-empty folder, it will simply yell at you. respect. π₯
transfer(FTS, SourceFile, DestinationFile) -> Return
Types:
FTS = SourceFile = DestinationFile = #objref
Return = ok | {'EXCEPTION', E}
if the target object's associated FileTransferSession and the DestinationFile's associated FileTransferSession support the same protocol(s), this operation will copy the file represented by the SourceFile from the target object's file system to a file in the destination FileTransferSession's file system. the destination file is represented by the DestinationFile object and may not exist (it's fine, it's fine, it'll be created, chill).
π‘ important: this operation must be invoked on the FileTransferSession associated with the SourceFile object. yes. the source one. not the destination one. the SOURCE one. write that down. π
append(FTS, SourceFile, DestinationFile) -> Return
Types:
FTS = SourceFile = DestinationFile = #objref
Return = ok | {'EXCEPTION', E}
this operation behaves almost like the transfer/3 operation. the difference? the DestinationFile must exist, because the SourceFile will be appended to the DestinationFile. no destination, no append. that's the rule. π
β οΈ currently, it is not possible to use this operation when the target object represents FTP. nope. not happening. FTP said no. π
insert(FTS, SourceFile, DestinationFile, Offset) -> Return
Types:
FTS = SourceFile = DestinationFile = #objref
Offset = long()
Return = ok | {'EXCEPTION', E}
this operation behaves almost like the append/3 operation. the difference here is that the SourceFile will be inserted into the DestinationFile Offset bytes from the start of the file. so it's appending but at a specific spot. precision. main character energy. π
β οΈ currently, it is not possible to use this operation when the target object represents FTP. same energy as above. FTP stays excluded. π
logout(FTS) -> ok
Types:
FTS = #objref
this operation terminates the target object and closes the connection to the file system it represents. it's the "ok bye bestie π" of operations. no return value drama, just ok. clean exit. π«Ά
π the cute sign-off π
and that's the whole page, babes!! π this masterpiece was brought to you by Ericsson AB, running cosFileTransfer 5.2.2, and the footer was doing the exact same "my name is too long" bit as the header β CosFileTra...sferSession(3) β because consistency is a love language apparently. πβ¨ go forth and transfer some files, but NOT with FTP on append or insert, iykyk. ππ
π¦ where this page comes from
- fedora 43: erlang-cosFileTransfer 1:5.2.2-1.fc43 Β· Apache-2.0
- fedora 44: erlang-cosFileTransfer 1:5.2.2-1.fc44 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms