User guide
70
VTB USER GUIDE
Syntax
.Rename(oldpath as *char, newpath as *char) as char
Parameters
oldpath Name of file/directory to be renamed
newpath Name of the new file/directory to be renamed
Example
err=disk.Rename(”text.txt”,”data.dat”) ' rename the file text.txt with
' data.dat in the current directory
COPY
Duplicates a file. If a file with the destination name exists this is overwritten.
Syntax
.Copy(srcpath as *char, dstpath as *char) as char
Parameters
srcpath Name of the file to be duplicated, it can contain also the complete path
dstpath Name of the duplicated file, it can contain also the complete path
WARNING: The destination path must contain the name of the file. It can not refer only to the directory.
Example
err=disk.Copy(”text.txt”,”B:data.dat”) ' copy the file text.txt in driver B:
...
err=disk.Copy(”text.txt”,”\test\data.dat”) ' copy the file text.txt in the
... ' directory test
OPENDIR
Apre una cartella. E' il punto di partenza per una ricerca dei file presenti nel disco. Usata insieme a ReadDir.
Syntax
.OpenDir(path as *char) as char
Parameters
path Nome della cartella. Se la stringa è vuota viene presa la cartella corrente.
READDIR
Reads the informations of the first file/directory found in the FAT. The informations are saved in the structure
ObjectName_finfo.
Syntax
.ReadDir() as char
Structure ObjectName_finfo
.size File dimension
.date File date bit 0-4 day (1-31)
bit 5-8 month (1-12)
bit 9-15 year (0-99)
.time File time bit 5-10 minutes (0-59)
bit 11-15 hour (0-23)
.attrib Attribute bit 0 read-only