[archive] C$Fileinfo

[Migrated content. Thread originally posted on 30 September 2005]

Hello everyone,
I'm woandering about can I do a lookalike C$FILEINFO in a thin client environment. I mean C$FILEINFO doesen't support the
@[DISPLAY]: notation, so in if I've to check the presence of a certain file on a client path, I've to launch a C$SYSTEM with
csys-desktop attribute setted and the redirect it'output into a text file to parse. Not much handy and really slow.
Has someone an alternative idea to work it out?
Thanks In Advance and have a nice day, Giovanni
Parents
  • Hi, here's my working-storage:

    ******-----------------------------------------------------------------------
    01 util-finfo.
    02 uf-dati.
    04 uf-file.
    05 uf-file-name pic x(256).
    05 uf-file-location pic x(01).
    04 uf-file-info.
    05 uf-file-size pic x(08) comp-x.
    05 uf-file-date pic 9(08) comp-x.
    05 uf-file-time pic 9(08) comp-x.
    04 uf-status pic 9(08).
    04 uf-esito pic x(01).
    02 uf-dati-w.
    04 uf-w-file-name pic x(256).

    78 k-w32-max-str value 260.
    *
    01 u-w32-file-name pic x(k-w32-max-str) value space.
    01 u-w32-file-handle usage handle.
    *
    01 u-w32-file-data.
    04 u-w32-dwFileAttributes usage unsigned-long.
    04 u-w32-ftCreationTime.
    06 u-w32-ftCreationTime-dwLow usage unsigned-long.
    06 u-w32-ftCreationTime-dwHigh usage unsigned-long.
    04 u-w32-ftLastAccessTime.
    06 u-w32-ftLastAccessTime-dwLow usage unsigned-long.
    06 u-w32-ftLastAccessTime-dwHigh usage unsigned-long.
    04 u-w32-ftLastWriteTime.
    06 u-w32-ftLastWriteTime-dwLow usage unsigned-long.
    06 u-w32-ftLastWriteTime-dwHigh usage unsigned-long.
    04 u-w32-nFileSize.
    06 u-w32-nFileSizeHigh usage unsigned-long.
    06 u-w32-nFileSizeLow usage unsigned-long.
    04 u-w32-dwReserved0 usage unsigned-long.
    04 u-w32-dwReserved1 usage unsigned-long.
    04 u-w32-cFileName pic x(k-w32-max-str).
    04 u-w32-cAlternateFileName pic x(13).

    ******--------------------------------------------------------------------------
    and here's the procedure:
    ******-------------------------------------------------------------------------
    call-finfo-thin-client.
    initialize util-cdll
    initialize u-w32-file-name u-w32-file-data
    move null to u-w32-file-handle
    move null to u-w32-file-name
    string uf-file-name delimited " "
    low-values delimited size into u-w32-file-name
    move null to u-w32-cFileName
    move null to u-w32-cAlternateFileName
    move "kernel32.dll" to u-cdll-dll-name
    move "FindFirstFileA" to u-cdll-dll-function

    perform call-dll-load

    call u-cdll-w-dll-function
    using by reference u-w32-file-name,
    by reference u-w32-file-data
    returning u-w32-file-handle
    on overflow
    *display overflow warning
    end-call

    if (u-w32-cFileName > 1)
    if (u-w32-cFileName <> low-values)
    move k-yes to uf-esito
    end-if
    end-if
    perform call-dll-unload
    .

    ******-------------------------------------------------------------------------
Reply
  • Hi, here's my working-storage:

    ******-----------------------------------------------------------------------
    01 util-finfo.
    02 uf-dati.
    04 uf-file.
    05 uf-file-name pic x(256).
    05 uf-file-location pic x(01).
    04 uf-file-info.
    05 uf-file-size pic x(08) comp-x.
    05 uf-file-date pic 9(08) comp-x.
    05 uf-file-time pic 9(08) comp-x.
    04 uf-status pic 9(08).
    04 uf-esito pic x(01).
    02 uf-dati-w.
    04 uf-w-file-name pic x(256).

    78 k-w32-max-str value 260.
    *
    01 u-w32-file-name pic x(k-w32-max-str) value space.
    01 u-w32-file-handle usage handle.
    *
    01 u-w32-file-data.
    04 u-w32-dwFileAttributes usage unsigned-long.
    04 u-w32-ftCreationTime.
    06 u-w32-ftCreationTime-dwLow usage unsigned-long.
    06 u-w32-ftCreationTime-dwHigh usage unsigned-long.
    04 u-w32-ftLastAccessTime.
    06 u-w32-ftLastAccessTime-dwLow usage unsigned-long.
    06 u-w32-ftLastAccessTime-dwHigh usage unsigned-long.
    04 u-w32-ftLastWriteTime.
    06 u-w32-ftLastWriteTime-dwLow usage unsigned-long.
    06 u-w32-ftLastWriteTime-dwHigh usage unsigned-long.
    04 u-w32-nFileSize.
    06 u-w32-nFileSizeHigh usage unsigned-long.
    06 u-w32-nFileSizeLow usage unsigned-long.
    04 u-w32-dwReserved0 usage unsigned-long.
    04 u-w32-dwReserved1 usage unsigned-long.
    04 u-w32-cFileName pic x(k-w32-max-str).
    04 u-w32-cAlternateFileName pic x(13).

    ******--------------------------------------------------------------------------
    and here's the procedure:
    ******-------------------------------------------------------------------------
    call-finfo-thin-client.
    initialize util-cdll
    initialize u-w32-file-name u-w32-file-data
    move null to u-w32-file-handle
    move null to u-w32-file-name
    string uf-file-name delimited " "
    low-values delimited size into u-w32-file-name
    move null to u-w32-cFileName
    move null to u-w32-cAlternateFileName
    move "kernel32.dll" to u-cdll-dll-name
    move "FindFirstFileA" to u-cdll-dll-function

    perform call-dll-load

    call u-cdll-w-dll-function
    using by reference u-w32-file-name,
    by reference u-w32-file-data
    returning u-w32-file-handle
    on overflow
    *display overflow warning
    end-call

    if (u-w32-cFileName > 1)
    if (u-w32-cFileName <> low-values)
    move k-yes to uf-esito
    end-if
    end-if
    perform call-dll-unload
    .

    ******-------------------------------------------------------------------------
Children
No Data