How to exclude a file in a special directory

284 views
Skip to first unread message

Gerhard Sommer

unread,
Nov 3, 2012, 7:29:53 AM11/3/12
to tacitd...@googlegroups.com
I would like for example to exclude all Files with file type .ini, but only in the root directory. Or an even simpler example: Exclude some named file like xxx.txt, but only, if it is in folder /xxx/yyy. I can not find out, how to achieve any of these exclusions. Can somebody help me?

Best Regards,
Gerhard

Gerhard Sommer

unread,
Nov 3, 2012, 12:15:04 PM11/3/12
to tacitd...@googlegroups.com
I tried the file filter of type "startswith", but with the path (a "/") before the file name. This would seem logical, as it works this way with folders. But it does not work for files.

By the way: The help page says:

To exclude or include only a specific "xyz" folder you have to include a forward slash ("/") in the name you specify. Then you can exclude a folder and all its sub folders with a folder filter of type "startswith" with value  "/mnt/sdcard/rootfolder/xyz". When using full path in a filter please only use the "startswith" type filter.

This does not work as described in the example. You would have to use "/xyz" (the remote path instead of the local path). So the help should be changed.

Support User

unread,
Nov 5, 2012, 2:21:45 PM11/5/12
to tacitd...@googlegroups.com
You cannot use rules containing foldernames with files.

You should be able to use a regular expression - but don't ask my how to create a regular expression, because I probably know less about that, than I know about piloting a F22..

Regarding the help page, all rules are on the what the local file or folder name is or would be, since a remote folder may not be a "normal" looking path depending on provider type.

Best regards
Anders Carlsen
Software Developer

If you like our apps, please give them a 5-star rating. Thanks. :-)
 
Tacit Dynamics


Gerhard Sommer

unread,
Nov 7, 2012, 7:58:21 PM11/7/12
to tacitd...@googlegroups.com
I tried to use a regex, but it did not work. There are different dialects of regular expressions. To use such an expression, I would need to know at least, which dialect you used in your app. You developed the app after all, so you should know something about regex, at least what regex library you used.

I have paired a folder like /mnt/sdcard/xxx on my Android device to the Dropbox root directory. So the remote path is /. When I exclude /mnt/sdcard/xxx/yyy/zzz, as you describe it on your help page, it does not work, while using /yyy/zzz works. Do you have an explanation for that?

Best Regards,
Gerhard

Support User

unread,
Nov 8, 2012, 2:26:13 PM11/8/12
to tacitd...@googlegroups.com
Foldersync the regex libraries found in Android (Java).

And guess I was wrong by previous statement - filters work against both remote and local path.

Gerhard Sommer

unread,
Nov 10, 2012, 2:59:37 PM11/10/12
to tacitd...@googlegroups.com
So I did something wrong when I tried it with the local path. I tried it again and the local path excluded the folder as you said.

Regex does not work for excluding files in a certain path. At least I did not find out how, though the hint at the Java Regex should have helped (the escape with double \ instead of single was completely new for me). Without knowledge how it is implemented, I can only use try and error though.

Would it be so difficult to implement excluding files in a path in future version of foldersync?

Best Regards,
Gerhard
Reply all
Reply to author
Forward
0 new messages