Subversion Repositories wimsdev

Rev

Rev 20 | Rev 17533 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
# This script has the right to write to a file in the user's getfile
2
# directory.
3
# Format of input: multi-line.
4
# Line 1: two words. Word 1: file name. Word 2: "append" or "new".
5
# 	Word 2 defaults to "append".
6
# Line 2 and up: content to write.
7
 
8
tgf_1=!line 1 of $wims_read_parm
9
tgf_c=!line 2 to -1 of $wims_read_parm
10
!distribute words $tgf_1 into tgf_w1, tgf_w2
11
tgf_w1=!replace internal getfile/ by $ in $tgf_w1
12
!if $tgf_w1=$empty or / isin $tgf_w1 or .. isin $tgf_w1
12325 bpr 13
  !exit
20 reyssat 14
!endif
15
!if $tgf_w2=new
12325 bpr 16
  !filewrite getfile/$tgf_w1 $tgf_c
20 reyssat 17
!else
12325 bpr 18
  !fileappend getfile/$tgf_w1 $tgf_c
20 reyssat 19
!endif
20