The FILECOPY command
#4
(06-15-2025, 06:21 PM)Tillmann Viefhaus Wrote: I found the error. I just had the wrong filename which was the one of the program I was working with. The file A used in FILECOPY must never contain the name or parts of the name of a programm which is just running.

No. The running program only has a write lock applied. I still can be read – what PB's filecopy is doing.

I just have tested it:

Code:
#compile exe
#dim all

function pbmain () as long
    local sFileA as string
    local sFileB as string
    sFileA = "test.exe"    ' This running program
    sFileB = "copy_of_test.exe"
    filecopy sFileA,sFileB
    if err then
       stderr str$(err)+": "+error$(err)
    end if
    if isfile(sFileB)=0 then
       stderr "Filecopy did not succeed."
    end if
end function

The filecopy is doing fine.
„Let the machine do the dirty work.“
The Elements of Programming Style, Brian W. Kernighan, P. J. Plauger 1978
Reply


Messages In This Thread
The FILECOPY command - by Tillmann Viefhaus - 06-15-2025, 05:04 PM
RE: The FILECOPY command - by Albert Richheimer - 06-15-2025, 06:00 PM
RE: The FILECOPY command - by Tillmann Viefhaus - 06-15-2025, 06:21 PM
RE: The FILECOPY command - by Albert Richheimer - 06-15-2025, 07:50 PM
RE: The FILECOPY command - by Dale Yarker - 06-16-2025, 12:17 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)