Old 31st May 2019, 06:25   #1
samiz
Junior Member
 
Join Date: Jun 2003
Posts: 12
CreateDirectory sets error but still creates dir

Hi,

I am creating a dir on network share and it raises error flag but also creates the directory.
-----------
ClearErrors
StrCpy $1 "\\nibs.elegent.net\uscda-dfs\LABDATA\LABS\CPCDE-PSFU\Rocks\2015\SharedFiles\TestDir"
CreateDirectory "$1"

IfErrors DIRERROR+1

-----

The above code jumps to DIRERROR label, AND the directory does get created.

Anybody know why is it happening? Is there any special character which is causing to raise flag?

Network is all accessible, and directory gets created without any error thru windows explorer.
samiz is offline   Reply With Quote
Old 31st May 2019, 11:51   #2
samiz
Junior Member
 
Join Date: Jun 2003
Posts: 12
On some different network environment, CreateDirectory fails to create directory and raises error flag, when thru windows explorer, one can create folder.
samiz is offline   Reply With Quote
Old 31st May 2019, 17:08   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,150
NSIS basically does:
Quote:
error = CreateDirectory(path, NULL) ? ERROR_SUCCESS : GetLastError();
if (error != ERROR_SUCCESS) exec_error++;
so I don't really understand what the issue might be.

Does it only happen on network drives? Is it a Samba host?

What does Process Monitor say?

How can I reproduce this?

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st June 2019, 10:38   #4
ahmett
Junior Member
 
Join Date: Jan 2008
Posts: 18
StrCpy $1 "\\nibs.elegent.net\uscda-dfs\LABDATA\LABS\CPCDE-PSFU\Rocks\2015\SharedFiles\TestDir"
IfFileExists "$1\*.*" +4
CreateDirectory "$1"
IfFileExists "$1\*.*" +2
Goto DIRERROR
ahmett is offline   Reply With Quote
Old 1st June 2019, 10:44   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,150
I did not mean the NSIS code, I'm talking about Windows versions. What is nibs.elegent.net\uscda-dfs? I'm assuming it's a DFS share? But is it Windows server or Samba?

Anyway, there is not much we can do about this since we just call the Windows API normally. But knowing what Process Monitor says would be helpful.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st June 2019, 10:54   #6
ahmett
Junior Member
 
Join Date: Jan 2008
Posts: 18
I just wrote an alternative code for samiz to try
ahmett is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump