[system] / trunk / xmlrpc / lib / WeBWorK / PG / IOglue.pl Repository:
ViewVC logotype

Diff of /trunk/xmlrpc/lib/WeBWorK/PG/IOglue.pl

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 499 Revision 500
1#!/usr/bin/perl -w 1################################################################################
2# WeBWorK xmlrpc (c) 2000-2002 WeBWorK Project
3# $Id$
4################################################################################
5
6package WeBWorK::PG::IO;
2 7
3use strict; 8use strict;
9use warnings;
10use Exporter;
4 11
12our @ISA = qw(Exporter);
13our @EXPORT = qw(
14 includePGtext
15 send_mail_to
16 read_whole_problem_file
17 read_whole_file
18 convertPath
19 getDirDelim
20 getCourseTempDirectory
21 surePathToTmpFile
22 fileFromPath
23 directoryFromPath
24 createFile
25 createDirectory
26 REMOTE_HOST
27 REMOTE_ADDR
28);
29
30
5=head2 Private functions (not methods) used by PGtranslator for file IO. 31=head2 Private functions (not methods) used by PGtranslator for file IO.
6 32
7
8
9=cut 33=cut
10 34
11my $REMOTE_HOST = (defined( $ENV{'REMOTE_HOST'} ) ) ? $ENV{'REMOTE_HOST'}: 'unknown host'; 35our $REMOTE_HOST = (defined( $ENV{'REMOTE_HOST'} ) ) ? $ENV{'REMOTE_HOST'}: 'unknown host';
12my $REMOTE_ADDR = (defined( $ENV{'REMOTE_ADDR'}) ) ? $ENV{'REMOTE_ADDR'}: 'unknown address'; 36our $REMOTE_ADDR = (defined( $ENV{'REMOTE_ADDR'}) ) ? $ENV{'REMOTE_ADDR'}: 'unknown address';
13 37
14 38
15=head2 includePGtext 39=head2 includePGtext
16 40
17 includePGtext($string_ref, $envir_ref) 41 includePGtext($string_ref, $envir_ref)
164=cut 188=cut
165 189
166## converts full path names to to use the $dirDelim instead of / 190## converts full path names to to use the $dirDelim instead of /
167 191
168sub convertPath { 192sub convertPath {
169 &Global::convertPath; 193 return wantarray ? @_ : shift;
170} 194}
171 195
172# hacks to make this program work independent of Global.pm 196# hacks to make this program work independent of Global.pm
173sub getDirDelim { 197sub getDirDelim {
174 return ("/"); 198 return ("/");
308 warn("$0: createDirectory error", " Can't do chmod($permission, $dirName)"); 332 warn("$0: createDirectory error", " Can't do chmod($permission, $dirName)");
309 unless ($numgid == -1) {chown(-1,$numgid,$dirName) or 333 unless ($numgid == -1) {chown(-1,$numgid,$dirName) or
310 warn("$0: createDirectory error", " Can't do chown(-1,$numgid,$dirName)");} 334 warn("$0: createDirectory error", " Can't do chown(-1,$numgid,$dirName)");}
311} 335}
312 336
313 3371;

Legend:
Removed from v.499  
changed lines
  Added in v.500

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9