Jump to content
Sign in to follow this  
CyberSlug

FileInstall 3.0.81

Recommended Posts

CyberSlug

Through my unofficial documentation project, I think I've uncovered a bug in FileInstall.

$x =  FileInstall("C:\foo\blah.txt", "C:\bar\")
 MsgBox(0,"ErrorFlag " & @error, "Result is " & $x)

When the script is not compiled, the return value is always 0--regardless of success. Compiled scripts return the correct value.

Also, the destination path must contain a trailing backslash in order for the operation to work. I can document this requirement; however, this behavior is inconsistent with other functions.


Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!

Share this post


Link to post
Share on other sites
Valik

Through my unofficial documentation project, I think I've uncovered a bug in FileInstall.

$x =  FileInstall("C:\foo\blah.txt", "C:\bar\")
 MsgBox(0,"ErrorFlag " & @error, "Result is " & $x)

When the script is not compiled, the return value is always 0--regardless of success.  Compiled scripts return the correct value.

Also, the destination path must contain a trailing backslash in order for the operation to work.  I can document this requirement; however, this behavior is inconsistent with other functions.

Technically, it is not inconsistent. The second parameter is the full path to the destination. FileInstall("C:\foo\blah.txt", "C:\bar") would install "blah.txt" to the extension-less file "C:\bar". If you want to preserve the original filename, you have to put a \ so it's interpreted as a directory and not as a filename; alternatively, you could specify "C:\bar\blah.txt" (or any other filename...). The same holds true for the FileCopy, FileMove and about any DOS, Windows or *nix program which uses paths.

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.