Habs hin bekommen..
PHP-Code:
h dftactgrp(*noOption( *NoDebugIO bnddir('QC2LE')                 
h datfmt(*dmy.) timfmt(*hms:) datedit(*dmy.) decedit('0,'debug(*yes)
                                                                      
d Lesen           s               *                                   
d FILE_i          s               *                                   
d FILE_o          s               *                                   
d ErrTxt          s            128a                                   
d String          s            512a                                   
d String_aus      s            512a    Varying                        
d rc              s             10i 0                                 
d File_Input      s            200                                    
d File_Output     s            200                                    
d Laenge          s             10i 0                                 
d                                                                     
d
* -- IFS stream file functions: -----------------------------------**
D open            Pr              *   ExtProc'_C_IFS_fopen' )       
D                                 *    Value Options( *String )       
D                                 *    Value Options( *String )       
**                                                                    
D fgets           Pr              *   ExtProc'_C_IFS_fgets' )  
D                                 *    Value                     
D                               10i 0  Value                     
D                                 
*    Value                     
**                                                               
D fputs           Pr            10i 0 ExtProc'_C_IFS_fputs' )  
D                                 *    Value Options( *String )  
D                                 *    Value                     
**                                                               
D remove          Pr            10i 0 ExtProc'unlink')         
D                                 *    Value Options( *String )  
**                                                               
D close           Pr            10i 0 ExtProc'_C_IFS_fclose' 
D                                 *    Value                     
                                                                 
c                                                                
c                   
Eval      File_Input  ='/home/MyFile.txt'    
c                   Eval      File_Output ='/home/MyNewFile.txt' 
c                   Eval      File_O Open( %TrimRFile_Output)
c                                          'w, codepage=850'  )          
c                   Eval      RC CloseFile_O )                         
c                   Eval      File_O Open( %TrimRFile_Output)          
c                                          'w'                )          
c                   Eval      File_I Open( %TrimRFile_Input )          
c                                          'r'                )          
c                   If        File_I = *Null                               
c                   
Eval      ErrTxt = %CharErrno ) + ': ' +             
c                                      Strerror                            
c                   
Else                                                   
c                   Eval      Lesen fgets( %Addr( String )               
c                                          : %Size( String )               
c                                          File_i         )              
c                   DoW       Lesen <> *Null                               
c                   
Eval      Laenge = %Len( %Str(Lesen ) )                
c                   Eval      String_aus = %SubSt(%Str(lesen)              
c                                                 Laenge-1)          
c                   Eval      String_aus = %Trim(String_aus) +'neuer Text'+
c                                          x'25'                           
c                   Eval      rc fputsString_aus              
c                                       
File_o                
c                   Eval      Lesen fgets( %Addr( String )      
c                                          : %Size( String )      
c                                          File_i         )     
c                   EndDo                                         
c                   
Eval      rc CloseFILE_i )                
C                   EndIf                                         
c                   Eval      rc CloseFILE_o )                
c                                                                 
c                   
Eval      *InLr  = *On                        
**                                                                
**-- 
Get runtime error number: -----------------------------------
P Errno           B                                               
D                 Pi            10i 0                             
D sys_errno       Pr              
*   ExtProc'__errno' )        
D Error           s             10i 0 BasedpError NoOpt       
C                   
Eval      pError sys_errno                  
C                   
Return    Error 
P Errno           E                                                   
                                                                      
**-- Get runtime error text: --------------------------------------** 
P Strerror        B                                                   
D                 Pi           128a   Varying                         
D sys_strerror    Pr              
*   ExtProc'strerror' )           
D                               10i 0 Value                           
C                   
Return    %Strsys_strerrorErrno ))            
P Strerror        E