I cannot seem to be able to call ForceDirectories()
on a NAS partition on Windows 10 64-bit.
I can create a folder on the NAS using Windows Explorer just fine.
procedure TForm3.Button1Click(Sender: TObject);
var
tempDir: String;
begin
tempDir := 'z:\ttt\ttttest';
if NOT DirectoryExists(tempDir) then
if System.SysUtils.ForceDirectories(tempDir) then
ShowMessage('Dir: ' + tempDir + ' Forced alright')
else
ShowMessage('Dir: ' + tempDir + ' Force FAILED with error : '+ IntToStr(GetLastError));
end;
Z:
is the Western Digital Network Attached Storage which works fine in all other respects.
The code returns error 3 every time.
Same code works correctly on local drives.