os.Path methods

 

These methods are used to handle files and directories on the server side.

 

 os.Path methods can be used to:

 

Some methods can be used on UNIX systems only.

 

 

os.Path methods are invoked in the following way:

 

CALL os.Path.<Method>(<parameters>)

 

os.Path.atime()

returns date and time when the specified file was accessed for the last time

os.Path.basename()

returns a string value standing for the last element of the path

os.Path.chdir()

changes the current working directory

os.Path.chown()

changes the UNIX owner and the group of the specified file

os.Path.chrwx()

changes the UNIX permission of the specified file

os.Path.chvolume()

changes the current working volume

os.Path.copy()

creates a new file by copying the already existing one

os.Path.delete()

deletes the specified file or directory

os.Path.dirclose()

closes the directory referenced by the directory handle

os.Path.dirfmask()

defines a filter mask for os.Path.diropen

os.Path.dirname()

returns all components of a path excluding the last one

os.Path.dirnext()

reads the next entry in the directory

os.Path.diropen()

opens a directory and returns this directory an integer handle

os.Path.dirsort()

defines sort order and sort criteria for the opened directory

os.Path.executable()

checks whether the file is executable

os.Path.exists()

checks whether the file exists

os.Path.extension()

returns the file extension

os.Path.gid()

returns the UNIX group id of the specified file

os.Path.homedir()

returns the path to the current user HOME directory

os.Path.isdirectory()

checks whether a file is a directory or not

os.Path.isdirectorysym()

resolves a symbolic link and checks whether the resolved path is directory or not

os.Path.isfile()

checks whether a file is regular

os.Path.ishidden()

checks whether the file is hidden

os.Path.islink()

checks whether a file is a UNIX symbolic link

os.Path.isroot()

checks whether a file path is a root path

os.Path.join()

joins two segments of the path and adds the platform-dependent separator to the returning path

os.Path.mkdir()

creates a new directory

os.Path.mtime()

returns the time of the latest modification of a file

os.Path.pathseparator()

returns the path separator

os.Path.pathtype()

checks whether a path is relative or absolute

os.Path.pwd()

returns the current working directory

os.Path.readable()

checks whether the file is readable

os.Path.rename()

changes the name of a file or directory

os.Path.rootdir()

returns the root directory of the current working path

os.Path.rootname()

returns the file path with its last element without an extension

os.Path.rwx()

returns the UNIX file permissions of a file

os.Path.separator()

returns the character that separates the path segments

os.Path.size()

returns the size of a file

os.Path.type()

returns the file type as a STRING

os.Path.uid()

returns the UNIX user id of a file

os.Path.volumes()

returns the available volumes

os.Path.writable()

checks whether the file is writable