SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

File list in application server



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Fri Aug 28, 2009 3:01 pm    Post subject: File list in application server Reply with quote

Author: Dariusz Sobczak

Code:
REPORT  ZIT_FIL_TEST                            .
TYPES: NAME_OF_DIR(1024)        TYPE C,
       NAME_OF_FILE(260)        TYPE C,
       NAME_OF_PATH(1285)       TYPE C.
 
DATA: BEGIN OF searchpoints OCCURS 10,
        dirname     TYPE NAME_OF_DIR,  " name of directory.
        sp_name     TYPE NAME_OF_FILE, " name of entry. (may end with *)
        sp_cs(10)   TYPE c, " ContainsString pattern for name.
      END OF searchpoints.
DATA: BEGIN OF file,
        dirname     TYPE NAME_OF_DIR,  " name of directory. (possibly
                                       " truncated.)
        name        TYPE NAME_OF_FILE, " name of entry. (possibly
                                       " truncated.)
        type(10)    TYPE c,            " type of entry.
        len(8)      TYPE p,            " length in bytes.
        owner(8)    TYPE c,            " owner of the entry.
        mtime(6)    TYPE p, " last modification date, seconds since 1970
        mode(9)     TYPE c, " like "rwx-r-x--x": protection mode.
        useable(1)  TYPE c,
        subrc(4)    TYPE c,
        errno(3)    TYPE c,
        errmsg(40)  TYPE c,
        mod_date    TYPE d,
        mod_time(8) TYPE c,            " hh:mm:ss
        seen(1)     TYPE c,
        changed(1)  TYPE c,
      END OF file.
 
   CALL 'C_DIR_READ_FINISH'
       ID 'ERRNO'  FIELD file-errno
       ID 'ERRMSG' FIELD file-errmsg.
 
  searchpoints-dirname = '.'.
*  searchpoints-sp_name  = '*'.
  searchpoints-sp_name  = 'dev_tp'.
  CALL 'C_DIR_READ_START' ID 'DIR'    FIELD searchpoints-dirname
                          ID 'FILE'   FIELD searchpoints-sp_name
                          ID 'ERRNO'  FIELD file-errno
                          ID 'ERRMSG' FIELD file-errmsg.
  WRITE: / file-errmsg.
  IF sy-subrc  0.
     sy-subrc = 4.
     EXIT.
  ENDIF.
 
  DO.
    CLEAR file.
    CALL 'C_DIR_READ_NEXT'
      ID 'TYPE'   FIELD file-type
      ID 'NAME'   FIELD file-name
      ID 'LEN'    FIELD file-len.
    CASE sy-subrc.
      WHEN 0.
        WRITE: / file-name, file-len.
      WHEN 1.                     " end of directory
        EXIT.
      WHEN 4.                     " filename too long
      WHEN OTHERS.
    ENDCASE.
  ENDDO.
 
 CALL 'C_DIR_READ_FINISH'
   ID 'ERRNO'  FIELD file-errno
   ID 'ERRMSG' FIELD file-errmsg.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Connect to External system, Unix и Perl All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.