Jump to content

FileGetAttribute / DirCopy bug?


Recommended Posts

Hello,

While working on a script and testing the DirCopy function i came across this issue...

On Windows you can create a "Briefcase" (Right-Click in a folder > New > Briefcase).

I tried to use DirCopy on that Briefcase as FileGetAttribute returns "RD" (Read-only + Directory). It copies but the copied Breifcase is now corrupt?.

Tried FileCopy too but it does the same thing.

$attrib = FileGetAttrib("C:\New Briefcase")
MsgBox(0, "Attribute", "Attribute: " & $attrib) ; show file/folder attribute

DirCopy("C:\New Briefcase", "C:\testFolder", 1) ; copy the briefcase

Thats just some example code.

a Briefcase is the only file/folder im getting this problem with.

Any ideas?

They call me MrRegExpMan

Link to comment
Share on other sites

whatever Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Link to comment
Share on other sites

Hello,

While working on a script and testing the DirCopy function i came across this issue...

On Windows you can create a "Briefcase" (Right-Click in a folder > New > Briefcase).

I tried to use DirCopy on that Briefcase as FileGetAttribute returns "RD" (Read-only + Directory). It copies but the copied Breifcase is now corrupt?.

Tried FileCopy too but it does the same thing.

$attrib = FileGetAttrib("C:\New Briefcase")
MsgBox(0, "Attribute", "Attribute: " & $attrib) ; show file/folder attribute

DirCopy("C:\New Briefcase", "C:\testFolder", 1) ; copy the briefcase

Thats just some example code.

a Briefcase is the only file/folder im getting this problem with.

Any ideas?

How about this:

DirCopy("C:\New Briefcase", "C:\testFolder", 1) ; copy the briefcase
FileSetAttrib("C:\testFolder", "+R")

Works like a charm. By the way many special folders ("My Documents", "Favorites") should have their attributes set explicitly in this way, otherwise they appear just like normal directories.

I don't think this is an AutoIt bug. At most you can make a feature request that DirCopy() flags could include "copy attributes" or something.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCE 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...