Announcement

Collapse

Maintenance

The forum could be offline for 30-60 minutes in the very near future for maintenance (said 3pm Pacific). I was behind on getting this notice. I do apologize.
See more
See less

Kill() files in Win95/98 without sending to Recycle Bin?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Kill() files in Win95/98 without sending to Recycle Bin?

    Im using Kill() to delete files - i DONT want the Recycle Bin involved at all (I thought you needed to use APIs to send files to the Recycle Bin anyway?)
    but under Win95/98, all files that I Kill() are being sent to the Recycle Bin!
    does anyone have a workaround?


    ------------------
    -

  • #2
    Use the DeleteFile API

    BOOL DeleteFile(
    LPCTSTR lpFileName // file name
    );
    Parameters
    lpFileName
    [in] Pointer to a null-terminated string that specifies the file to be deleted.
    Windows NT/2000: In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to nearly 32,000 wide characters, call the Unicode version of the function and prepend "\\?\" to the path. For more information, see File Name Conventions.

    Windows 95/98: This string must not exceed MAX_PATH characters.

    Return Values
    If the function succeeds, the return value is nonzero.

    If the function fails, the return value is zero. To get extended error information, call GetLastError.



    ------------------
    Patrice Terrier
    mailto[email protected][email protected]</A>
    Patrice Terrier
    www.zapsolution.com
    www.objreader.com
    Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

    Comment


    • #3
      Patrice, many thanks!
      I wrongly assumed that Kill() was an indirect way of using the DeleteFile API call, obviously not ...? I'm confused why Kill() sends to the Recycle Bin in 95/98 and not NT/2K though, but DeleteFile has solved my problem, so thanks again :-)


      ------------------
      -

      Comment


      • #4
        If, by "Kill()", you mean the PowerBASIC statement "KILL"-- and you find that it's causing files to go to the Recycle Bin-- the cause is likely to be that you've installed a system utility, such as Norton Protected Recycle Bin, and told it to "recycle" files that would normally just be deleted.

        ------------------
        Tom Hanlin
        PowerBASIC Staff

        Comment

        Working...
        X