Announcement

Collapse
No announcement yet.

FileCopy/CopyFile

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

  • FileCopy/CopyFile

    Hi guys,

    may be I'm getting older, can't help. The following program
    works fine if C:\DEF.DAT doesn't exist (f.ex., starting the app
    for the first time), but if C:\DEF.DAT already exits (f.ex.,
    starting the app repeatedly), the app fails with ERROR 75.
    However, PB-help told me that "If the destination file already
    exists, it will be overwritten". That's it:
    Code:
    #Compile Exe
    #Register None
    #Include "Win32Api.INC"
    Function PbMain () As Long
        On Error Goto 1
        FileCopy "C:\ABC.DAT", "C:\DEF.DAT"  
        Msgbox "Ok."
        Exit Function
    1:: Msgbox "Error"+Str$(ERR)
    End Function
    Now, substituting PB-FileCopy by API-CopyFile
    (CopyFile "C:\ABC.DAT", "C:\DEF.DAT", 0), the app works
    fine (and repeatedly works fine without ERROR 75!). Another
    way is to KILL C:\DEF.DAT before PB-FileCopy. Rebooting doesn't
    help. Don't know what's my problem with FileCopy ....

    I'm using NT4 (build 1381, SP4) and PB6. Should I buy a new PC
    right away?

    Cheers, Hanns.
    Last edited by Gary Beene; 12 Jul 2014, 08:42 PM. Reason: Code: tags

  • #2
    hanns --
    1) buy a new pc
    2) then read http://www.powerbasic.com/support/pb...ead.php?t=2525
    3) and use copyfile

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

    Comment


    • #3
      Dragging out the old dog ...

      1) Just tomorrow 2) Did it 3) Nothing else

      Thanks Semen!
      Greetings, Hanns.


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

      Comment

      Working...
      X