Delete text file

Author: (orna)


U 7.2.06
I need to delete and copy  text files.
Tried: activate "winapi".DELETEFILE(filename)
and got -59 "Unable to locate 3GL function deletefileA"
In the .INI file under "demandload" there is a reference to the kernel32.dll,
the "winapi" signature is compiled.
Is there something that is missing?
and is there another way to do it (delete file) without using API?



  1. Hi orna,

    in Uniface 8+ there is the command "lfiledelete" etc.

    In Version 6, I used a BAT file to rename/copy/delete files (called via a link, so we could hide the window). 

    Success, Uli

    Author: ulrich-merkel (
  2. As long as you're on Uniface 7, there is no lfiledelete, that's from version 8 and on, like Uli already mentioned.

    Your solution should work; I use it too on my old 7.2.06 environment (migrating to 9 at the moment).

    First of all: Please check the paths to the dll in the usys.ini. These will vary per (Windows) platform. My usys.ini looks like this (for W2K PC's):


    The "DeleteFile" or  "DeleteFileA" is a kernel32 function.

    My code looks like this:

    operation DeleteFile

       string    ps_FileName   :IN

    activate "kernel32".DeleteFile(ps_FileName)

    return ($status)

    end ; DeleteFile

    And my signature "kernel32" has the operation "deletefile" with one in-parameter "filename", type string, interface char *, length 256. (Windows 2000 limits paths to 260 characters total length.)

    Hope this helps!

    Regards, Arjen

    Author: Arjen van Vliet (
  3. Thanks Uli & Arjen

    The problem with API is that we have users with Windows 2000 & XP
    and the kernel32.dll is not the same, and different .ini file is not an option.
    So, with bat file it works just fine.


    Author: orna (
  4. Hi,

    in UF 7  we used for such basic file operations like copy, delete, append, ..  an own dll written in c.
    This dll was linked with the 3GL stuff deliverd by uniface (h / lib)  and the name of the dll was placed in the .ini file in section [userdlls].

    The functions became a "part" of uniface (activated "silent" by the perform command).

    You need a C-compiler

    But perhaps this could be an alternative solution of calling external bat files for you.

    Kind regards,





    Author: BeSieben (