DelNode "... a better DeleteDirectory"

Share your advanced PureBasic knowledge/code with the community.
User avatar
bingo
Enthusiast
Enthusiast
Posts: 210
Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:

DelNode "... a better DeleteDirectory"

Post by bingo »

Code: Select all

Import "advpack.lib"
DelNode(path.l,flag.l)
EndImport
;for deleting c:\temp !!!
Debug DelNode(@"c:\temp",0) ; 0 = ok
the problem: DeleteDirectory (with #PB_FileSystem_Recursive) doesn't delete unicode-folders (if non-unicode exe) :(
["1:0>1"]
Fred
Administrator
Administrator
Posts: 18252
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Sounds like a bug, could you post a snippet showing the failing ?
User avatar
bingo
Enthusiast
Enthusiast
Posts: 210
Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:

Post by bingo »

create folder d:\temp and 3 subfolders

\Интернете
\Поиск
\test

run:
Debug DeleteDirectory("d:\temp","*.*",#PB_FileSystem_Recursive) ; =0

d:\temp\Интернете
d:\temp\Поиск

only d:\temp\test is missing ... :(

run , if unicode exe:
Debug DeleteDirectory("d:\temp","*.*",#PB_FileSystem_Recursive) ; =1 :wink:

the same problem with CopyDirectory ...
non unicode exe can not handle unicode subfolders/files (it is normal ... :cry: )
["1:0>1"]
Fred
Administrator
Administrator
Posts: 18252
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

and if you compiles in unicode mode ?
User avatar
bingo
Enthusiast
Enthusiast
Posts: 210
Joined: Fri Apr 02, 2004 12:21 pm
Location: germany/thueringen
Contact:

Post by bingo »

@fred

deletedirectory/copydirectory:

if program is compiled in unicode mode it works with unicode and non unicode folders/files .

if not ... it works with non unicode folders/files only !
["1:0>1"]
Fred
Administrator
Administrator
Posts: 18252
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

make sens..
Post Reply