You are here

Rule Exclude File

16 posts / 0 new
Last post
Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2007-01-12 19:22
Rule Exclude File

Hello everybody!

I'm trying to exclude all temp Word files from mirroring, but seems that it won't work...
I created a rule with "exclude file" with ~$*.doc but the files are still copied.

am I doing it wrong?

Thanks! (:

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2005-12-10 15:22
What

is the form of the temp files? Your regex looks ok at a quick glance, but I am not exactly sure what you are trying to match!

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
Regular expression?

If that's meant to be a regular expression, not a glob expression, then the * should be .*.

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2007-01-12 19:22
.

I'm trying to 'ignore' files like ~$document_name.doc

Darkbee
Darkbee's picture
Offline
Last seen: 4 years 6 months ago
Joined: 2008-04-14 09:41
Give Us a Clue

I give up, I can't get it to work either.

I believe what the OP is trying to do is ignore any files that begin with the literals "~$" and then contain 0 or more alphanumeric characters, a period literal and the "doc" file extension. Wouldn't you have to escape the "$" and "." in a true regular expression? I'm assuming a "~" doesn't need to be escaped.

To the OP, shouldn't those files get normally get deleted? The only time they hang around is if you:

  1. Currently have the file open
  2. Didn't shut down Office correctly

Steve, I've also noticed that if you delete all of your rules-sets and then go back to the Sync tab, all the rules-sets previously created still appear. How do you handle refreshes between tabs? Is that one of the purposes of the Refresh button? If I modify a set of rules, how do I know that the Sync tabs is using the modified set of rules and not the previous version? Likeiwse, if I use "Preview" does in then load the rules, or does it used some sort of cached copy? It almost feels like there's a disconnect between the sync and rules tabs (at least in 3.0.3)

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2007-01-12 19:22
.

Yeah, like you said these files are normally deleted when you close Word, but sometimes Word/PC crashes and they are left behind in folder.
On my work place we use shared folders and it's not uncommon these files appear.

Chris Morgan
Chris Morgan's picture
Offline
Last seen: 9 years 5 months ago
Joined: 2007-04-15 21:08
What I said

If it's meant to be a regular expression, * means any number of the previous atom - so you should put a . before it, which matches any character:

~$.*\.doc

(Second . escaped to make sure it's a literal .)

I am a Christian and a developer and moderator here.

“A soft answer turns away wrath, but a harsh word stirs up anger.” – Proverbs 15:1

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2007-01-12 19:22
.

Still not working. I gave up that.

-
Another problem:

I have set some folders to exclude, it's working fine, the content of the folder isn't copied (as it should be), but the folder itself and all subfolders are created on destiny (empty, of course).
Wouldn't be correct not create the folders we put on "folder to exclude"?

Darkbee
Darkbee's picture
Offline
Last seen: 4 years 6 months ago
Joined: 2008-04-14 09:41
Doesn't Work

The regexes in Toucan aren't POSIX necessarily (or whatever the right term is) they're some kind of hybrid WXWidgets creation. I don't find the WxWidgets documentation particularly helpful. Some examples in the documentation wouldn't go amiss.

In addition, the Toucan documentation states that you're supposed to begin a regular expression with an asterisk, which is very odd IMO (since it gives "*" a double meaning). It has been my experience that regexes should normally begin with a forward slash, but again this is probably part of the odd WxWidgets implementation.

As I mentioned above, technically you should probably escape the dollar sign too since that has syntactical meaning. However, I've tried many possible combinations of "normal" regular expressions I can think of, to no avail (not that I'm an expert).

In fact, I don't think I've got a single regular expression to work in Toucan so far, only a simple text exclusion. Sad

Darkbee
Darkbee's picture
Offline
Last seen: 4 years 6 months ago
Joined: 2008-04-14 09:41
Regex Parser Problems

I've been doing some more digging and it seems there's a problem with Toucan's regex parser. I don't know if it's part by design or part bug but I've reported it in the current development release thread.

Steve Lamerton
Steve Lamerton's picture
Offline
Last seen: 11 years 2 months ago
Developer
Joined: 2005-12-10 15:22
Thanks

for all of your comments here guys, you have spurred me on to properly sorting out some of the rules stuff. I am targeting a proper fix of this (along with a few other changes to the rules, like absolute excludes and a proper gui update) in the release after next Smile I will try and also get a quite fix out in the next one and will update here when the next pre-release is out.

kethal
Offline
Last seen: 12 years 9 months ago
Joined: 2010-09-21 15:06
My Rule

I use *~.* which seems to work fine. This rule ignores any file starting with a ~. If you wanted to ignore files starting with "~$" and ending with ".doc" try "*~\$.*\.doc" (which may not actually work).

As stated in the help file, rules must begin with "*" to be treated as regular expressions. This is at any rate a rather unintuitive way to do it. Perhaps you could just have a check box saying "This is a regular expression".

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2007-01-12 19:22
.

Thanks! Now it's working! But, why we need a dot after ~?

kethal
Offline
Last seen: 12 years 9 months ago
Joined: 2010-09-21 15:06
Regular expressions

Although "*" is used to mean "match anything" in other pattern matching syntaxes, in regular expression "." means "match any single character" and "*" means "match the previous thing any number of times (including 0 times)", so ".*" means "match anything (including nothing)".

The syntax gets a bit complex, but regular expressions are possibly the most useful thing a computer user can learn. More here: http://www.regular-expressions.info/.

Ph4n70m
Ph4n70m's picture
Offline
Last seen: 2 years 5 months ago
Joined: 2007-01-12 19:22
.

Ahhh... now I understood Acute
I'll read more about regular expression.

Thanks again

Corndawg
Offline
Last seen: 11 years 2 months ago
Joined: 2013-08-29 13:04
Old topic but I found it in a

Old topic but I found it in a google search so I thought I'd reply:

*~$* is the correct expression. I just tested it on a Word 2010 temp file.

Also someone asked why to do this when Word deletes these files automatically. Well I use RealtimeSync a lot so whenever I open a document in a synced dir (even if I don't save), it triggers the sync to occur after my specified delay. So this is useful to keep from copying a large amount of ridiculous files and deleting them again a min later.

Of course telling RealtimeSync to ignore even triggering the Sync when a ~$whatever file opens in the first place would be the real fix, but this is acceptable.

Log in or register to post comments