API:EPrints/Platform

From EPrints Documentation
Revision as of 18:29, 11 August 2009 by Tdb01r (talk | contribs) (New page: <!-- Pod2Wiki=_preamble_ This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. -...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki

NAME

EPrints::Platform - handles platform specific code.

DESCRIPTION

When you call a method in this class, it is sent to the appropriate EPrints::Platform::xxx module. Usually this is EPrints::Platform::Unix

Which module is used is configured by the {platform} setting in SystemSettings.pm

All file and directory names are absolute and joined by the Unix file separator character '/'.

chmod

 chmod( MODE, @filelist )

Change the access control on files listed in @filelist to MODE.

chown

 chown( $uid, $gid, @filelist )

Change the user and group on files listed in @filelist to $uid and $gid. $uid and $gid are as returned by getpwnam (usually numeric).

getpwnam

 getpwnam( $user )

Return the login-name, password crypt, uid and gid for user $user.

getpwnam

 getpwnam( $user )

Return the login-name, password crypt, uid and gid for user $user.

test_uid

 test_uid()

Test whether the current user is the same that is configured in SystemSettings.

mkdir

 mkdir( $path, MODE )

Create a directory $path (including parent directories as necessary) set to mode MODE. If MODE is undefined defaults to dir_perms in SystemSettings.

exec

 exec()

Executes certain named tasks, which were once (and may be) handled by external binaries. This allows a per-platform solution to each task. (example is unpacking a .tar.gz file).

read_perl_script

 $rc = read_perl_script( $repository, $filename, @args )

Executes Perl with @args, including the current EPrints library path. Writes output from the script to $filename (errors and stdout).

Returns 0 on success.

get_hash_name

 get_hash_name()

Returns the last part of the filename of the hashfile for a document. (yes, it's a bad function name.)

free_space

 free_space( $dir )

Return the amount of free space (in bytes) available at $dir. $dir may contain a drive (C:) on Windows platforms.

proc_exists

 $bool = proc_exists( $pid )

Returns true if a process exists using id $pid.

Returns undef if process identification is unsupported.

UNDOCUMENTED METHODS

Warning These methods were found in the source code but didn't have any POD associated with them. This may be because we haven't got around to documenting them yet or it could be because they are internal to the API and not intended for use by other parts of EPrints.

getgrnam