Jump to content

Recommended Posts

Posted (edited)
  On 8/12/2013 at 10:48 AM, AZJIO said:

DXRW4E

It is other task. The task of checking the validity of the path. And it isn't carried out fully. If it isn't carried out, and the meaning of it dubious.

I believe that we are not well understood

;@DesktopDir & "\FileExists.au3" = "C:\Users\\\DXRW4E///\\Desktop\\\\\\FileExists.au3"
If FileExists("C:\Users\\\DXRW4E///\\Desktop\\\\\\FileExists.au3") Then
    MsgBox(4096, "C:\Users\\\DXRW4E///\\Desktop\\\\\\FileExists.au3", "Exists")
Else
    MsgBox(4096, "C:\Users\\\DXRW4E///\\Desktop\\\\\\FileExists.au3", "Does NOT exists")
EndIf

this is a valid path ehhhhhhhh ;), the _PathSplit() only aesthetically repair, so _PathSplit() is in line with all other AutoIt native function

#include <Array.au3>
#include <File.au3>

Local $sDrive = "", $sDir = "", $sFilename = "", $sExtension = ""
Local $aPathSplit, $sPath = "C:\Users\\\DXRW4E///\\Desktop\\\\\\FileExists.au3"

 $aPathSplit = _PathSplit($sPath, $sDrive, $sDir, $sFilename, $sExtension) ; 3.3.9.16
_ArrayDisplay($aPathSplit)

ConsoleWrite('$sDrive = ' & $sDrive & @LF & _
        '$sDir = ' & $sDir & @LF & _
        '$sDir = ' & $sFilename & @LF & _
        '$sExtension = ' & $sExtension & @LF & @LF)

;~ in $aPathSplit Return
;~ [0]|C:\Users\\\DXRW4E///\\Desktop\\\\\\FileExists.au3
;~ [1]|C:
;~ [2]|\Users\\\DXRW4E///\\Desktop\\\\\\
;~ [3]|FileExists
;~ [4]|.au3

;~ >Running:(3.3.9.16):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\Users\DXRW4E\Desktop\New AutoIt v3 Script (Beta).au3"    
;~ --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
;~ $sDrive = C:
;~ $sDir = \Users\DXRW4E\Desktop\
;~ $sDir = FileExists
;~ $sExtension = .au3

but fixes this invalid Path (as mentioned is a crazy thing, will not have to ever happen), is only a precaution nothing else

#include <Array.au3>
#include <File.au3>

Local $sDrive = "", $sDir = "", $sFilename = "", $sExtension = ""
Local $aPathSplit, $sPath = "C: \ Users \/\ DXRW4E //\\ Desktop \\\ FileExists.au3"

 $aPathSplit = _PathSplit($sPath, $sDrive, $sDir, $sFilename, $sExtension) ; 3.3.9.16
_ArrayDisplay($aPathSplit)

ConsoleWrite('$sDrive = ' & $sDrive & @LF & _
        '$sDir = ' & $sDir & @LF & _
        '$sDir = ' & $sFilename & @LF & _
        '$sExtension = ' & $sExtension & @LF & @LF)

;~ in $aPathSplit Return
;~ [0]|C: \ Users \\ DXRW4E //\\ Desktop \\\ FileExists.au3
;~ [1]|C:
;~ [2]| \ Users \/\ DXRW4E //\\ Desktop \\\
;~ [3]|FileExists
;~ [4]|.au3

;~ >Running:(3.3.9.16):C:\Program Files (x86)\AutoIt3\Beta\autoit3.exe "C:\Users\DXRW4E\Desktop\New AutoIt v3 Script (Beta).au3"
;~ --> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
;~ $sDrive = C:
;~ $sDir = \Users\DXRW4E\Desktop\
;~ $sDir = FileExists
;~ $sExtension = .au3

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

  • Replies 43
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted (edited)

Hi AZJIO, is a crazy thing & with it should never happen, it means that that's not a responsibility of the _PathSplit if an is Path is invalid, as said to be 100% sure (for the path that is valid or not valid) is better to use the

  On 8/11/2013 at 7:16 AM, DXRW4E said:

however is only _PathSplit() everything else about Path (how to say in an Microsoft official way) is in AutoIt help WinApiEx ShellPath Management (#include <WinAPIShPath.au3>.)

which are those that are 100% compatible with windows

Ciao.

Edited by DXRW4E

apps-odrive.pngdrive_app_badge.png box-logo.png new_logo.png MEGA_Logo.png

Posted

Unfortunately we can't always protect users from themselves.

UDF List:

  Reveal hidden contents

Updated: 22/04/2018

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...