Retrouve taille d'un fichier IFS (CPP)

BoTTom |
      * NOTE: Compiler avec DFTACTGRP(*NO)
      *
      * IFS API prototypes
      *
      * stat()
      *
     Dstat             PR            10I 0 extproc('stat')
     Dpathptr                          *   value
     Dstatptr                          *   value
      *
      * variables de travail
      *
     D statds          DS
     D  mode                         10U 0
     D  ino                          10U 0
     D  nlink                         5U 0
     D  filler1                       5U 0
     D  uid                          10U 0
     D  gid                          10U 0
     D  size                         10U 0
     D  filler2                     256
 
     DFile_exists      S             10I 0
     Dpathptr          S               *
     Dpathname         S            256
     Dstatptr          S               *
      *
      * Main{}
      *
     C     *entry        plist
     C                   parm                    filename        255
     C                   parm                    taille           10 0
      * attribution d'un pointeur sur la variable nom du chemin
     C                   eval      pathname = %trim(filename)+x'00'
     C                   eval      pathptr = %addr(pathname)
     C                   eval      statptr = %addr(statds)
      * Appel de l'API IFS
     C                   eval      File_Exists = stat(pathptr:statptr)
     c
     C                   if        File_Exists = 0
     c                   eval      taille = size
     c                   endif
      * fin du pgm.
     C                   move      *on           *inlr





©AF400