Jump to content

Copy UDF


Yashied
 Share

Recommended Posts

@freMea

Odds are if the example was posted, then it at least works for him. If you're so much a noob that you are unable to provide relevant information regarding your errors, then maybe you're not ready for this UDF. Just saying...

Yes, you're right: I'm so much a noob! I'll be back when I'm ready. :graduated:

See you.

[list][*]AutoIt 3.3.8.1[*]Win XP PRO SP3[/list]

Link to comment
Share on other sites

(makes seperate "Yashied" folder.) :graduated:

"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

  • 1 month later...

You're example doesn't work at home (XP PRO SP3, AutoIt v3.3.6.1) "No files were copied".

The source folder contains 5 files and the target folder is empty.

What did I miss?

Hi freMea,

Sorry for the late reply..

Search for the following code

$sFileCount = 0

$sFolderCount = 0

_CopyData(GUICtrlRead($SourceInput), GUICtrlRead($DestinationInput) & '\' & $Current, True)

Switch @error

and replace it with

$sFileCount = 0

$sFolderCount = 0

DirCreate(GUICtrlRead($DestinationInput) & '\' & $Current)

_CopyData(GUICtrlRead($SourceInput), GUICtrlRead($DestinationInput) & '\' & $Current, True)

Switch @error

Could you try again ?!

Thanks

Emiel

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

Could you try again ?!

Thanks for your reply.

It partially works. I tried to copy:

source folder=C:\Program Files\Fichiers communs

target folder=D:\Téléchargement\Téléchargement Internet\Temp

All the files and subdirectories are copied but the target folder is altered to D:\Téléchargement\Téléchargement Internet\Temp\1

[list][*]AutoIt 3.3.8.1[*]Win XP PRO SP3[/list]

Link to comment
Share on other sites

thanks very much Yashied!

i was wondering if it supports wildcards e.g.

_copy_CopyFile('C:\temp*.tmp','D:\temp*.tmp')

thx

[font=arial, sans-serif]How is education supposed to make me feel smarter? Besides, every time I learn something new, it pushes some old stuff out of my brain. Remember when I took that home winemaking course, and I forgot how to drive?[/font][font=arial, sans-serif]<div>This is how you annoy a web developer.</span>[/font]

Link to comment
Share on other sites

Thanks for your reply.

It partially works. I tried to copy:

source folder=C:\Program Files\Fichiers communs

target folder=D:\Téléchargement\Téléchargement Internet\Temp

All the files and subdirectories are copied but the target folder is altered to D:\Téléchargement\Téléchargement Internet\Temp\1

This is correct

The first time it is copied to \1

The Second time it is copied to \2

Best regards,Emiel Wieldraaijer

Link to comment
Share on other sites

  • 2 weeks later...

Hi

I did try to use this one but it dident work ,I have copied all the files to my script directory but still it wont work .

can you please tell me what I need to do with the #Include <Copy.au3> ,to where do I need to copy the "Copy.zip" content ?

Thanks :x

Link to comment
Share on other sites

  • 2 weeks later...

I was wondering what the best way would be to have the option to exclude files/folders? I also second the question on whether this UDF supports wildcards? If not, how hard would that be to implement?

Edited by CGRemakes
Link to comment
Share on other sites

Let me bump a reply by James:

No, it's not reasonable for part of the UDF.

The idea of a UDF is to allow developers to write their own wrappers around the functions provided. It's up to you to use Copy.au3 to make it act like you want it to.

Search for a FileListToArray UDF matching your needs and combine it with this one.
Link to comment
Share on other sites

  • Moderators

CGRemakes,

Search for a FileListToArray UDF

Try the RecFileListToArray UDF in my sig - it has both include and exclude options. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

CGRemakes,

There are lots of that type of script on the forum - I have no idea which is most "efficient". Just try some and see if they work for you. ;)

My version does have a lot of options beyond the include/exclude lists - such as sorting the results, limiting the level of recursion, the level of path information added to the file name..... :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

CGRemakes,

There are lots of that type of script on the forum - I have no idea which is most "efficient". Just try some and see if they work for you. ;)

My version does have a lot of options beyond the include/exclude lists - such as sorting the results, limiting the level of recursion, the level of path information added to the file name..... :)

M23

That's understandable. Yeah, the large number of options is what makes it somewhat to determine which one will work best. Sorting isn't important, nor is limiting the level of recursion (at least in my case). Include/exclude is really the only additional feature I need. It would be nice to find one that has a way of excluding a specific path, not just a filename/directory (meaning I could exclude c:\temp\file.txt, and not just file.txt). I'm guessing I'll have to find one and tweak it to get it to work the way I want. I'll play with a few different options and see what works best.

Edited by CGRemakes
Link to comment
Share on other sites

What Melba really meant was that you should download the function RecFileListToArray linked in his signature, that's all you every need.

I know what he meant. I looked at it, in addition to a few other options. His is an acceptable option, I just don't need some of the extra features like sorting. Whether I use his or another one, most likely I'll have to tweak it so the exclude option allows for an entire path (with wildcards), not just an individual file/folder. For example, say I want to exclude C:\temp\test.txt file, but I want to include c:\temp\temp\test.txt. I need to have greater flexibility on how to specify exactly which one I want to exclude. I have not yet found one that will allow that. They only allow me to exclude test.txt, which would exclude it from both those paths. Yes, I suppose I could include an extra check after returning all the files, but it's just another check that should probably be done as it's gathering all the file structure info into the array in the first place.

Edited by CGRemakes
Link to comment
Share on other sites

  • Moderators

CGRemakes,

an acceptable option

You do have a way with words..... :)

Enjoy writing your own version - I know how long it took to write mine to an acceptable level. :idiot:

Please do feel free to use of any of the code in my UDF. ;)

M23

Edit: Removed some unnecessary text. :idiot:

Edited by Melba23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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...