YaST2 Developers Documentation: YaST2

YaST2

modules/FileUtils.ycp
Module for getting information about files and directories. Their types and sizes. Flags: Stable

This module has an unstable interface.

Imports

  • SCR

Global Functions

global Exists (string target) -> boolean

Function which determines if the requested file/directory exists.

Parameters:
target
Return value:
true if exists
global IsDirectory (string target) -> boolean

Function which determines if the requested file/directory is a directory or it is a link to a directory.

Parameters:
target
Return value:
true if it is a directory, nil if doesn't exist
global IsFile (string target) -> boolean

Function which determines if the requested file/directory is a regular file or it is a link to a regular file.

Parameters:
target
Return value:
true if it is a regular file, nil if doesn't exist
global IsBlock (string target) -> boolean

Function which determines if the requested file/directory is a block file (device) or link to a block device.

Parameters:
target
Return value:
true if it is a block file, nil if doesn't exist
global IsFifo (string target) -> boolean

Function which determines if the requested file/directory is a fifo or link to a fifo.

Parameters:
target
Return value:
true if it is a fifo, nil if doesn't exist
global IsLink (string target) -> boolean

Function which determines if the requested file/directory is a link.

Parameters:
target
Return value:
true if it is a link, nil if doesn't exist
global IsSocket (string target) -> boolean

Function which determines if the requested file/directory is a socket or link to a socket.

Parameters:
target
Return value:
true if it is a socket, nil if doesn't exist
global IsCharacterDevice (string target) -> boolean

Function which determines if the requested file/directory is a character device or link to a character device.

Parameters:
target
Return value:
true if it is a charcater device, nil if doesn't exist
global GetFileRealType (string target) -> string

Function returns the real type of requested file/directory. If the file is a link to any object, "link" is returned.

Parameters:
target
Return value:
fle type (directory|regular|block|fifo|link|socket|chr_device), nil if doesn't exist
global GetFileType (string target) -> string

Function returns the type of requested file/directory. If the file is a link to any object, the object's type is returned.

Parameters:
target
Return value:
fle type (directory|regular|block|fifo|link|socket|chr_device), nil if doesn't exist
global GetSize (string target) -> integer

Function which returns the size of requested file/directory.

Parameters:
target
Return value:
file size, -1 if doesn't exist
global GetOwnerUserID (string target) -> integer

Function which determines the owner's user ID of requested file/directory.

Parameters:
target
Return value:
UID, nil if doesn't exist
global GetOwnerGroupID (string target) -> integer

Function which determines the owner's group ID of requested file/directory.

Parameters:
target
Return value:
GID, nil if doesn't exist