mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-02-10 10:30:58 +00:00
Fix copy directory destination
This commit is contained in:
parent
b2eaa867eb
commit
18543c8363
@ -9,6 +9,7 @@ var arg, exit, srcfilelist, srcfileptr, srccnt
|
|||||||
var copybuff, copyrel, copysize
|
var copybuff, copyrel, copysize
|
||||||
byte recurse, dstlen
|
byte recurse, dstlen
|
||||||
char[64] curpath, dstpath
|
char[64] curpath, dstpath
|
||||||
|
char[16] srcdir
|
||||||
res[t_fileinfo] srcfileinfo, dstfileinfo
|
res[t_fileinfo] srcfileinfo, dstfileinfo
|
||||||
//
|
//
|
||||||
// Copy path with upper case conversion
|
// Copy path with upper case conversion
|
||||||
@ -245,11 +246,18 @@ if not except(exit)
|
|||||||
//
|
//
|
||||||
srcfileptr = srcfilelist
|
srcfileptr = srcfilelist
|
||||||
while srccnt
|
while srccnt
|
||||||
|
dstlen = dstpath
|
||||||
if fileio:getfileinfo(srcfileptr, @srcfileinfo) == FILE_ERR_OK and srcfileinfo.file_type == $0F
|
if fileio:getfileinfo(srcfileptr, @srcfileinfo) == FILE_ERR_OK and srcfileinfo.file_type == $0F
|
||||||
if recurse
|
if recurse
|
||||||
//
|
//
|
||||||
// Copy directory
|
// Copy directory
|
||||||
//
|
//
|
||||||
|
if dstpath[dstpath] <> '/'
|
||||||
|
dstpath++
|
||||||
|
dstpath[dstpath] = '/'
|
||||||
|
fin
|
||||||
|
filefrompath(@srcdir, srcfileptr)
|
||||||
|
strcat(@dstpath, @srcdir)
|
||||||
if fileio:getfileinfo(@dstpath, @dstfileinfo) <> FILE_ERR_OK
|
if fileio:getfileinfo(@dstpath, @dstfileinfo) <> FILE_ERR_OK
|
||||||
fileio:create(@dstpath, $0F, $0000)
|
fileio:create(@dstpath, $0F, $0000)
|
||||||
fin
|
fin
|
||||||
@ -268,6 +276,7 @@ if not except(exit)
|
|||||||
// Copy files
|
// Copy files
|
||||||
//
|
//
|
||||||
copyfiles(srcfileptr, @dstpath)
|
copyfiles(srcfileptr, @dstpath)
|
||||||
|
dstpath = dstlen
|
||||||
srcfileptr = srcfileptr + ^srcfileptr + 1
|
srcfileptr = srcfileptr + ^srcfileptr + 1
|
||||||
srccnt--
|
srccnt--
|
||||||
loop
|
loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user