Modify

Opened 9 years ago

Closed 8 years ago

#2043 closed Bug (Works For Me)

IniRead, IniReadSection don't access ,INI files from mapped drives

Reported by: qgam.mad@… Owned by:
Milestone: Component: AutoIt
Version: 3.3.6.1 Severity: None
Keywords: Iniread Cc:

Description

IniRead gives always default results from 'x.ini' at working dir or in @ScriptDir&'\x.ini' whem @workingdir or @scriptdir are folders in a mapped drive. But @error is 0

Accidentally, I needed to move the folder \DEV from local disk B: to N:\AutoIt in another disk (a shared folder).. Then I dropped disk B:, mapped B: to N;\AutoIt and tried to continue using the programs.

But a lot of my programas in the folder DEV gave bad results - both from Scite and .exe, when accesed from DEV in mapped drive B:. Those use IniRead. IniRead see an existing .ini file, but process it as if the .ini file were an empty file (the same for IniReadSection). Nevertheless the results are as good as expected when programs are accesed form DEV in N:\AutoIt (N: is a local drive).

It happens as if InitRead cannot read the .ini file when .ini drive is mapped. But IniRead don't see this as an error
and don't @errot to 1.

SHORT TEST SCRIPT

$inifile=FileGetLongName(@ScriptDir&"\script.ini")
ConsoleWrite('========== CONTENTS ===========' &@CRLF&FileRead($inifile)&@CRLF&'================================'&@CRLF)
;get editor command from Script.ini (default Notepad) at @Scriptdir, then at @WorkingDir
For $x=1 to 2
	ConsoleWrite('inifile=='&$inifile&@CRLF)
	$editor=IniRead ($inifile, "edit", "Editor", 'notepad.exe "%1"' )
	ConsoleWrite('IniRead @error='&@error&"               RESULTS:" _
			     &@CRLF&"  Scriptdir = "&@ScriptDir&@CRLF&"  WorkingDir = "&@WorkingDir&@CRLF&"  Editor = "&$editor&@CRLF)
	ConsoleWrite('------------------- $x='&$x&' ----------------------------- '&@CRLF)
	FileChangeDir(@ScriptDir)
	$inifile=FileGetLongName("script.ini")
Next
MsgBox(0,"End "&@ScriptFullPath," See results; click to exit")
Exit

RESULTS WHEN @Scriptdir==@WorkingDir==N:\AutoIt\DEV

====== Script.ini CONTENTS =====
[edit]
Editor=AnotherEditor.exe %1
================================
inifile==N:\AutoIt\DEV\Script.ini
IniRead @error=0 RESULTS:

Scriptdir = N:\AutoIt\DEV
WorkingDir = N:\AutoIt\DEV
Editor = AnotherEditor.exe %1 <--- AS EXPECTED


inifile==script.ini
IniRead @error=0 RESULTS:

Scriptdir = N:\AutoIt\DEV
WorkingDir = N:\AutoIt\DEV
Editor = AnotherEditor.exe %1 <--- AS EXPECTED


RESULTS WHEN @Scriptdir==@WorkingDir==B:\DEV (B: mapped to N:\AutoIt)

====== Script.ini CONTENTS =====
[edit]
Editor=AnotherEditor.exe %1
================================
inifile==B:\DEV\Script.ini
IniRead @error=0 RESULTS:

Scriptdir = B:\DEV
WorkingDir = B:\DEV
Editor = notepad.exe "%1" <--- NOT AS EXPECTED: Default result


inifile==script.ini
IniRead @error=0 RESULTS:

Scriptdir = B:\DEV
WorkingDir = B:\DEV
Editor = notepad.exe "%1" <--- NOT AS EXPECTED: Default result


I use AutoIt a lot. Thank you for this marvellous work !!'''

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by anonymous

Workaround:
I don't devise any other way that the following annoying one (going to try):
Use a copy of the .INI file in a local disk (in @TempDir)

comment:2 Changed 8 years ago by Valik

  • Resolution set to Works For Me
  • Status changed from new to closed

Everything works fine for me whether I access through the mapped drive, the remote share or the local drive.

Closing as works for me.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.