Current Windows username
Get the name of the current Windows user.
1 2 3 4 5 6 |
var nm: string; begin nm:= GetCurUserName(); ShowMessage(nm); end; |
Get the name of the current Windows user.
1 2 3 4 5 6 |
var nm: string; begin nm:= GetCurUserName(); ShowMessage(nm); end; |
The function checks for different levels of file/folder access rights for the current user.
1 2 3 4 5 6 7 8 9 |
var path: string; level: cardinal; begin path:= 'C:\Program Files'; level:= FILE_GENERIC_READ; if getNTFSRules(path, level) = level then ShowMessage('Чтение разрешено') else ShowMessage('Чтение запрещено') ; end; |
Defines the bitness (32/64-bit) of the operating system.
1 2 3 4 5 6 |
var is64: Boolean; begin is64 := IsOS64bit(); if is64 = true then ShowMessage('64 бит') else ShowMessage('32 бит'); end; |
Gets the size of the folder with all its contents.
1 2 3 4 5 6 7 8 9 10 11 12 |
var path: string; incSubDirs: boolean; size: int64; begin path:= 'C:\Program Files'; incSubDirs:= true; size:= 0; getDirSize(path, incSubDirs, size); ShowMessage(IntToStr(size)); end; |
The function gets the size of the file. The file size can be over 2 GB.
1 2 3 4 5 6 7 8 9 |
var path: string; size: int64; begin path:= 'C:\Windows\notepad.exe'; size:= fileGetSize(path); ShowMessage(IntToStr(size) + ' byte'); end; |
Displays the file size in readable form, in specified or autodetected units.
1 2 3 4 5 6 7 |
var fileSize: int64; precision: integer; begin fileSize:= 8784641646; formatBytes(fileSize, sfAuto, 2); end; |
The function returns the path to the file / folder pointed to by a Symbolic link or Junction Point.
1 2 3 4 5 6 7 8 9 |
var path: string; linkTarget: string; begin path:= 'C:\Documents and Settings'; linkTarget:= SymLinkTarget(path); ShowMessage(linkTarget); end; |