Sets file permissions for a file or directory. Requires correct user access or root. Permissions are as Linux chmod numeric value.
1 = execute 2 = write 4 = read
644 = owner read/write (4 + 2), group read, other read 755 = owner read/write/execute (4 + 2 + 1), group read/execute, other read,execute
Uses Root if available.
cp (SrcAsString, DestAsString) AsBoolean
Copy a file from Src to Dest
Returns True on success. Uses Root if available.
cpr (SrcAsString, DestAsString) AsBoolean
Recursive copy just like the Linux cp -r Copies all files and directories under the Src path to Dest.
Works with directories, but is meaningless for files. Returns True on success. Uses Root if available.
createZipFile (pathAsString)
Creates a backup zip of the directory path
dirEntries (DirAsString) Asjava.util.ArrayList
Returns a list of formatted directory entries or an empty list on failure. As in :
d---rwxr-x system sdcard_rw 2011-11-13 12:59 LOST.DIR
Each element is in the form of a space separated string of
permissions and type (drwxr-xr-x) where the first char indicates a directory, link, or regular file (d, l, or -). owner name group name file size date time file name
Note that this method makes every attempt to fill in a size for symlinks and directories This means that you should always get 7 fields.
Uses Root if available.
ErrStrAsString
The StdErr interface used by most commands. This should contain any error message from the OS.
Escape (fnameAsString) AsString
Escapes spaces, "(" and ")" characters in a filename returns the original string if already escaped.
Unzips zipName from fromDir to toDir. toDir will be created if needed.
FSerrorAsString
The value of stderror is set to this stringafter each call if it is empty, there was no error.
fsStdOutAsString
Contains the Linux StdOut result of a command. This is what you would see in a Linux console if the command is successful.
GetDiskstats (PathAsString) AsString
Returns information of the given partition or pathname as a string formatted as
Size Used Free
each field is seperated with a single space.
For example:
[code] Dim fs as MLFiles Dim tmp as String
tmp = fs.GetDiskstats("/mnt/sdcard") [/code}
In the example above, tmp Might return :
8G 57M 8G
If busybox is present, the output will be in bytes for each field.
Uses Root if available.
GetFileDate (FnameAsString) AsLong
Gets the last modified date and time of a file or directory. Returns the timestamp in milliseconds.
GetFileExt (FNameAsString) AsString
Returns the file extension (if available) of the file FName otherwise returns the entire path and filename sent
GetFileType (FnameAsString) AsString
Gets the filetype of Fname.
Returns file type as a String on success or Unknown on failure. Returns standard mime types such as:
text/plain audio/mpeg text/XML image/jpeg
as file types
GetFreespace (PathAsString) AsLong
Returns the available space of the given partition/disk as a Long
Path is the mount point or directory within a partition
Note that some partitions are protected and will not return a value.
GetGigsFree (PathAsString) AsDouble
Returns the available space of the given partition/disk in gigabytes
Path is the partition path or directory within a partition Format is a boolean that will convert the return value to a gigabyte number. Otherwise the number of bytes is returned.
Note that some partitions are protected and will not return a value.
GetPerms (fnameAsString) AsString
Example: perms = GetPerms(filename)
Returns a Linux style permission string "rwxrwxrwx" rwx for each of owner, group, and others. Use - for no permission, like "rw-r--r--" for owner read write, group read, and others read. Works with files or directories.
GetRoot
Attempts to gain root access. Sets HaveRoot to True on success
GetSymlink (FnameAsString) AsString
Gets the target of a symbolic link in string format.
HaveBBAsBoolean
True if busybox is installed.
HaveRootAsBoolean
True if GetRoot succeeds.
HaveTBAsBoolean
True if toolbox is installed.
isDir (PathAsString) AsBoolean
Returns true if Path is a directory
IsReadable (FnameAsString) AsBoolean
Returns True if file or directory is readable to this user process.
isSymlink (FnameAsString) AsBoolean
Returns True if file or directory is a symbolic link.
IsWritable (FnameAsString) AsBoolean
Returns True if file or directory is writable to this user process.
mkdir (DirAsString) AsBoolean
Make a directory and any needed parent directories
Returns True on success Uses Root if available.
mv (OldnameAsString, NewnameAsString) AsBoolean
Use to move or rename files or directories from Oldname to Newname.
Returns True on success. Uses Root if available.
OutStrAsString
The StdOut interface returned by some commands. This will contain what would normally be text output to a linux terminal.
ReadTxtFile (FnameAsString) AsString
Reads a text file and returns its contents in a StringBuilder. Uses Root if available.
rm (FnameAsString) AsBoolean
Remove (delete) a file or directory Directories must be empty
Returns True on success. Uses Root if available.
rmrf (FnameAsString) AsBoolean
Remove (delete) a directory recursively. ALL files and sub-directories will be deleted, EMPTY OR NOT.
Executes a system command or program through the root adapter. Uses standard permissions if root is not available.
Command - the command to execute Args - the arguments to the command StdOut - the text that would appear in a linux console StdErr - any error text returned by the command useBB - use busybox for the command if available
Returns true on success.
SdcardAsString
Returns the path to the external SD card if present as a string including the ending / like /mnt/sdcard/
returns an empty string if not present
SdcardReadyAsString
Returns a state string for the external sdcard.
mounted = mounted and ready unmounted = card present but unmounted bad removal = sdcard removed without closing removed = no card present nofs = unformatted or unknown filesystem shared = mount point is currently shared with usb device unmountable = sdcard is present but damaged checking = media is being scanned mounted read only = sdcard is not writable
SetFileDate (FnameAsString, TimeAsLong) AsBoolean
Sets file date and time on Fname to Time in milliseconds. Returns True on success.
Returns an Int representing the type of SMB object for this SambaFile from 0 through 6
TYPE_FILESYSTEM, a regular file or directory TYPE_WORKGROUP, A workgroup TYPE_SERVER, a Samba server TYPE_SHARE, a shared directory TYPE_PRINTER, a shared printer TYPE_NAMED_PIPE, a named pipe TYPE_COMM, a communications device