From: Rob H. <for...@us...> - 2003-01-06 09:49:33
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/File In directory sc8-pr-cvs1:/tmp/cvs-serv17142/File Modified Files: Unix.pm Log Message: all API docs transferred from docs/API to POD. some need to be formatted better, and some of the docs are incomplete, but it's really close now :) Index: Unix.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File/Unix.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -U2 -r1.7 -r1.8 --- Unix.pm 5 Jan 2003 08:59:08 -0000 1.7 +++ Unix.pm 6 Jan 2003 09:49:30 -0000 1.8 @@ -1,7 +1,441 @@ -#lib/SandWeb/File/Unix.pm -# - =pod =head1 + +# lib/SandWeb/File/Unix.pm +# +# This class handles all file viewing and operations on Unix systems. +# It is only intended to be called by the File class. +-------------------------------------------------------------------------------- +METHOD + new + +SYNOPSIS + + my $file = SandWeb::File->new( + location => $location; + filename => $filename; + ); + + +DESCRIPTION + + This method is a constructor. It needs to know the location of the + file as well as the name of the file. + +PARAMETERS + + location (type: string) (required) + + This contains the full ( absolute or relative ) path + to the file, as far as the file system is concerned. + + Default: none. + + filename (type: string) (required) + + This contains the full name of the file, as far as the + file system is concerned. + + Default: none. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_owner + +SYNOPSIS + + my $owner = $file->get_owner(); + +DESCRIPTION + + Returns the UID of the owner of the file. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_group + +SYNOPSIS + + my $group = $file->get_group(); + +DESCRIPTION + + Returns the GID of the group membership of the file. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_filename + +SYNOPSIS + + my $filename = $file->get_filename(); + +DESCRIPTION + + Returns the full name of the file. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_location + +SYNOPSIS + + my $location = $file->get_location(); + +DESCRIPTION + + Returns the full ( absolute or relative ) path + to the file. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_permissions + +SYNOPSIS + + my $permissions = $file->get_permissions(); + +DESCRIPTION + + Returns the current file system permissions, + as an octal value. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_file_type + +SYNOPSIS + + my $file_type = $file->get_file_type(); + +DESCRIPTION + + Returns Perl's guess as to what type of file + this is. Type returned one of : Binary, Text, + Directory or Unknown. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_size + +SYNOPSIS + + my $file_size = $file->get_size(); + +DESCRIPTION + + Returns the size of the file, in bytes. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + get_age + +SYNOPSIS + + my $age = $file->get_age(); + +DESCRIPTION + + Returns the date of the last modification to this + file, in local time ( day month date time year ). + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + create_file + +SYNOPSIS + + my $return = $file->create_file(); + +DESCRIPTION + + Creates a file, using the filename passed to the constructor. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + create_folder + +SYNOPSIS + + my $return = $file->create_folder(); + +DESCRIPTION + + Creates a folder ( also known as a directory ) using the + filename passed to the constructor. + +PARAMETERS + + None. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + copy + +SYNOPSIS + + my $return = $file->copy( tofile => "alternate_name.c" ); + +DESCRIPTION + + Creates an exact copy of the file. + +PARAMETERS + + tocopy (type: string) (required) + Contains the full path and filename of the copy. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + rename + +SYNOPSIS + + my $return = $file->rename( tofile => "alternate_name.c" ); + +DESCRIPTION + + Renames an existing file. This is the same thing as a move, + as far as the file system and operating system are concerned. + +PARAMETERS + + tocopy (type: string) (required) + Contains the full path and filename of the new file. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + remove_file + +SYNOPSIS + + my $return = $file->remove_file(); + +DESCRIPTION + + Removes the file specified in the constructor. + +PARAMETERS + + none. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +-------------------------------------------------------------------------------- + +METHOD + remove_folder + +SYNOPSIS + + my $return = $file->remove_folder(); + +DESCRIPTION + + Removes the folder specified in the constructor. + +PARAMETERS + + none. + +RETURN CODES + + 1 = The operation completed successfully. + + 0 = This means that the method got an error proccessing your request. + Perhaps an invalid parameter? + + -1 = This return value means that there was not sufficient permision to + read the files specified, or they did not exist. + +#lib/SandWeb/File/Unix.pm +# SandWeb::File::Unix |