The Qt documentation in C++ of this class (QFile) can be read here: http://doc.trolltech.com/4.4/qfile.html, http://doc.trolltech.com/4.4/qfileinfo.html, http://doc.trolltech.com/4.4/qtextstream.html
It is useful to use the files.
Implemented since KBasic V1.76.
Normally, KBasic uses UTF-8 to load and save text files.
Static Function Size(FileName As String) As Long
Static Function Resize(FileName As String, NewSize As Long) As Boolean
Static Function Truncate(FileName As String) As Boolean
Sorry. Not supported yet.
Static Function SetReadable(FileName As String, Readable As Boolean, Who As String = “User”) As Boolean
Possible values for Who are
Sorry. Not supported yet.
Static Function SetWritable(FileName As String, Writable As Boolean, Who As String = “User”) As Boolean
Possible values for Who are
Sorry. Not supported yet.
Static Function SetExecutable(FileName As String, Executable As Boolean, Who As String = “User”) As Boolean
Possible values for Who are
Static Function ReadText(FileName As String, Codec As String = “UTF-8”, AutoDetectUnicode As Boolean = True, GenerateByteOrderMark As Boolean = True) As String
FileName might be any existing file or stderr, stdin, stdout.
Codec might be any value listed on http://doc.trolltech.com/4.4/qtextcodec.html#details
Commonly used is UTF-8, UTF-16 or UTF-32. Normally, choosing UTF-8 will be sufficient.
Reads the entire file into a string. |
Static Function WriteText(FileName As String, Text As String, Append As Boolean = False, Codec As String = “UTF-8”, AutoDetectUnicode As Boolean = True, GenerateByteOrderMark As Boolean = True) As Boolean
FileName might be any existing file or stderr, stdin, stdout.
Codec might be any value listed on http://doc.trolltech.com/4.4/qtextcodec.html#details
Commonly used is UTF-8, UTF-16 or UTF-32. Normally, choosing UTF-8 will be sufficient.
Erases previous existing contents of file. If you need to append to the file read the contents with ReadText, append the new string and write it back with WriteText. |
If you need ASCII-Code use ReadBinary and WriteBinary or use the following code snippset:
File.WriteText(strFln, strASCII, False, "ISO 8859-1", False, False)
Static Function ReadBinary(FileName As String) As String
FileName might be any existing file or stderr, stdin, stdout.
Reads the entire file into memory. |
Static Function WriteBinary(FileName As String, Binary As String, Append As Boolean = False) As Boolean
FileName might be any existing file or stderr, stdin, stdout.
Erases previous existing contents of file. If you need to append to the file read the contents with ReadBinary, append the new data and write it back with WriteBinary. |
Static Function Link(SourceFileName As String, DestinationFileName As String) As Boolean
Static Function Create(FileName As String) As Boolean
Static Function Remove(FileName As String) As Boolean
Static Function Copy(SourceFileName As String, DestinationFileName As String, Overwrite As Boolean = True) As Boolean
Static Function Move(SourceFileName As String, DestinationFileName As String, Overwrite As Boolean = True) As Boolean
Static Function Rename(SourceFileName As String, DestinationFileName As String) As Boolean
Static Function Exists(FileName As String) As Boolean
Static Function DateTimeCreatedAsString(FileName As String) As String
Static Function DateTimeUpdatedAsString(FileName As String) As String
Returns the last modification time of the contents of a file.
Static Function DateTimeReadAsString(FileName As String) As String
Returns the last access time of a file.
Static Function Owner(FileName As String) As String
Static Function Group(FileName As String) As String
Static Function IsReadable(FileName As String, Who As String = “User”) As Boolean
Possible values for Who are
Static Function IsWritable(FileName As String, Who As String = “User”) As Boolean
Possible values for Who are
Static Function IsExecutable(FileName As String, Who As String = “User”) As Boolean
Possible values for Who are
Static Function IsHidden(FileName As String) As Boolean
Static Function IsFile(FileName As String) As Boolean
Static Function WithNativeSeparators(FileName As String) As String
Static Function WithoutNativeSeparators(FileName As String) As String
Static Function SymLinkTarget(FileName As String) As String
Static Function Name(FileName As String) As String
Static Function Path (FileName As String) As String
Static Function Suffix(FileName As String) As String
Static Function IsRelative(FileName As String) As Boolean
Static Function IsSymLink(FileName As String) As Boolean