B4J Programming Press on the image to return to the main documentation page.

rSD

List of types:

File
SD

File


Events:

None

Members:


  IsDirectory As Boolean [read only]

  Name As String [read only]

  Size As ULong [read only]

Members description:

IsDirectory As Boolean [read only]
Returns true if this file entry is a directory.
Name As String [read only]
Returns the file name.
Size As ULong [read only]
Returns the file size (number of bytes).

SD


Events:

None

Members:


  Close As void

  CurrentFile As File [read only]

  Exists (FileName As String) As Boolean

  Initialize (CSPin As Byte) As Boolean

  ListFiles (DirName As String) As FileIterator

  OpenRead (FileName As String) As Boolean

  OpenReadWrite (FileName As String) As Boolean

  Position As ULong

  Remove (FileName As String) As Boolean

  Stream As B4RStream [read only]

Members description:

Close As void
Closes the current open file.
CurrentFile As File [read only]
Returns the current open file.
Exists (FileName As String) As Boolean
Checks whether the given file or directory exist.
Initialize (CSPin As Byte) As Boolean
Initializes the SD card. Returns true if the sd card was successfully initialized.
CSPin - Pin connected to the chip select line of the sd card.
ListFiles (DirName As String) As FileIterator
Can be used in a For Each loop to iterate over the files in the folder.
Example:
For Each f As File In sd.ListFiles("/")
  Log("Name: ", f.Name, ", Size: ", f.Size)
Next
OpenRead (FileName As String) As Boolean
Opens a file in read only mode. Returns true if the file was opened successfully.
OpenReadWrite (FileName As String) As Boolean
Opens a file in read and write mode. Returns true if the file was opened successfully.
Position As ULong
Gets or sets the position in the current open file.
Remove (FileName As String) As Boolean
Deletes the given file. Returns true if the file was successfully deleted.
Stream As B4RStream [read only]
Returns the stream of the current open file.
Top