Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading attribues of unix file in program

Former Member
0 Kudos

Hi All,

I want to use the attributes of unix file in program. Please tell me how i can do that ?

Attributes like :

1) date and time when file came in unix ( or created )

2) word count ( number of records ) of file

Thanks.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Check the unix command which gives the date and time of a file. Check the ls command man page , it gives some help.for the unix command wc gives the word, lines, character count.

wc -l lines, wc -c, characters.

REPORT ZUNIX line-size 400
                no standard page heading.
 
 
data: unixcom like   rlgrap-filename.   
 "dir ex: wc -l
unixcom = 'wc -l'.
 
data: begin of tabl occurs 500,
        line(400),
      end of tabl.
 
data: lines type i.
  
*----------------------------------------------------------------------
 
start-of-selection.
  refresh tabl.
 
  call 'SYSTEM' id 'COMMAND' field unixcom
                id 'TAB'     field tabl[].
 
 "tabl will have the output of the commnad
"loop it and get the result.

5 REPLIES 5

former_member585060
Active Contributor
0 Kudos

Use the FM

ADS2KIPUPL_GET_FILE_ATTRIBUTES Get Application Server File Attributes

former_member188685
Active Contributor
0 Kudos

Check the unix command which gives the date and time of a file. Check the ls command man page , it gives some help.for the unix command wc gives the word, lines, character count.

wc -l lines, wc -c, characters.

REPORT ZUNIX line-size 400
                no standard page heading.
 
 
data: unixcom like   rlgrap-filename.   
 "dir ex: wc -l
unixcom = 'wc -l'.
 
data: begin of tabl occurs 500,
        line(400),
      end of tabl.
 
data: lines type i.
  
*----------------------------------------------------------------------
 
start-of-selection.
  refresh tabl.
 
  call 'SYSTEM' id 'COMMAND' field unixcom
                id 'TAB'     field tabl[].
 
 "tabl will have the output of the commnad
"loop it and get the result.

Former Member
0 Kudos

I guess its a text file being read from a UNIX system.

Former Member
0 Kudos

Hi krishna,

This function module is not available in system.

Could you please tell me any other FM ?

Thanks.

Former Member
0 Kudos

Thanks vijay..

Full points to you.

Points assigned to everybody.