ccSmbToolsExt icon

ccSmbToolsExt

SMB Tools
ccSmbToolsExtAxon funcs

Registered StackHub users may elect to receive email notifications whenever a new package version is released or a comment is posted on the forum.

There are 0 watchers.

v1.1.0

smbReaderClose
smbReaderClose(smb)

Close the provided SmbReader along with any of its share or file connections.

Examples:

smbReaderOpen("10.0.0.1").smbReaderConnect("shareName").smbReaderClose

Side effects:

  • Closes completely the provided SmbReader instance.
Fantom signature:
@Axon static Void smbReaderClose(SmbReader smb)
smbReaderConnect
smbReaderConnect(smb, shareName)

Use the provided SmbReader instance to connect to a specific share name. The same SmbReader can be re-used for connecting to different shares, but just one at a time. Each time smbReaderConnect is called, the previous share connection is released.

Examples:

smbReaderOpen("10.0.0.1").smbReaderConnect("shareName")

Side effects:

  • Returns the same SmbReader instance ready for subsequent calls against the shareName now connected
Fantom signature:
@Axon static SmbReader smbReaderConnect(SmbReader smb, Str shareName)
smbReaderListFiles
smbReaderListFiles(smb, path, pattern)

Use the provided SmbReader instance to list files in a specific folder path, that match the provided file name pattern. The SmbReader must previously have been connected to a specific shareName using smbReaderConnect.

The same SmbReader can be re-used for connecting to different shares, but just one at a time. Each time smbReaderConnect is called, the previous share connection is released.

Examples:

smbReaderOpen("10.0.0.1").smbReaderConnect("shareName").smbReaderListFiles("dirName", "*.txt")

Side effects:

  • Returns a list of file names that matched the provided pattern in the folder name provided.
Fantom signature:
@Axon static Str[] smbReaderListFiles(SmbReader smb, Str path, Str pattern)
smbReaderMoveFile
smbReaderMoveFile(smb, path, filename, newPath, newFilename)

Use the provided SmbReader to cause the remote moving or renaming of a file.

which understands how to parse a binary byte stream.

Examples:

smbReaderOpen("10.0.0.1").smbReaderConnect("shareName").smbReaderMoveFile("dirName1", "file1.xlsx", "dirName2", "file3.xlsx")

Side effects:

  • If the path and newPath are different, the file will have changed directory location on the remote share
  • If the filename and newFilename are different, the file will have changed its name
  • If path and newPath are the same, only the filename will change
  • If path and newPath are the same and also filename and newFilename are the same, nothing will happen
Fantom signature:
@Axon static Void smbReaderMoveFile(SmbReader smb, Str path, Str filename, Str newPath, Str newFilename)
smbReaderOpen
smbReaderOpen(host, user: null, pass: null, domain: null, useSmbV1: false)

Construct an SMB Reader.

Examples:

smbReaderOpen("10.0.0.1")
smbReaderOpen("10.0.0.1", "user", "pass")
smbReaderOpen("10.0.0.1", "user", "pass", "DOMAIN")

Side effects:

  • Returns an instance of SmbReader which must be passed in on all subsequent calls that wish to use this reader
Fantom signature:
@Axon static SmbReader smbReaderOpen(Str host, Str? user := null, Str? pass := null, Str? domain := null, Bool? useSmbV1 := false)
smbReaderReadBinaryFile
smbReaderReadBinaryFile(smb, path, filename)

Use the provided SmbReader to read the contents of the named binary file in the named folder. The file contents will be returned as a Fantom Buf which can be passed to a function like poiReaderOpenBuf which understands how to parse a binary byte stream.

Examples:

smbReaderOpen("10.0.0.1").smbReaderConnect("shareName").smbReaderReadBinaryFile("dirName", "file1.xlsx")

Side effects:

  • Returns a binary Buf instance which can be used in further calls
Fantom signature:
@Axon static Buf smbReaderReadBinaryFile(SmbReader smb, Str path, Str filename)
smbReaderReadFile
smbReaderReadFile(smb, path, filename)

Use the provided SmbReader to read the contents of the named text file in the named folder. The file contents will be returned as a Str and can be further parsed by the calling Axon

Examples:

smbReaderOpen("10.0.0.1").smbReaderConnect("shareName").smbReaderReadFile("dirName", "file1.txt")

Side effects:

  • Returns a list of file names that matched the provided pattern in the folder name provided.
Fantom signature:
@Axon static Str smbReaderReadFile(SmbReader smb, Str path, Str filename)

Packages by Cool Planet Clarity Ltd

Free packages