06-15-2025, 07:50 PM
(This post was last modified: 06-15-2025, 07:51 PM by Albert Richheimer.)
(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
The Elements of Programming Style, Brian W. Kernighan, P. J. Plauger 1978