You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Li Zhengji (JIRA)" <ji...@apache.org> on 2008/06/24 03:19:45 UTC

[jira] Created: (COUCHDB-85) couch_server:all_databases() does not work on file name case-insensitive OS, such as Windows.

couch_server:all_databases() does not work on file name case-insensitive OS, such as Windows.
---------------------------------------------------------------------------------------------

                 Key: COUCHDB-85
                 URL: https://issues.apache.org/jira/browse/COUCHDB-85
             Project: CouchDB
          Issue Type: Bug
    Affects Versions: 0.8
         Environment: Windows XP, 	Erlang/OTP R12B-3
            Reporter: Li Zhengji


"Filename -- Root": the "--" here will not work as we want obviously. For example, Filename = "e:/aa.couch", Root = "E:/", then (Filename -- Root) = "eaa.couch". Not to say "/" and "\" on Windows.  

"--" should not be used here. The simple way to do this would be: delete(FileName, 1, length(Root)).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (COUCHDB-85) couch_server:all_databases() does not work on file name case-insensitive OS, such as Windows.

Posted by "Li Zhengji (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-85?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609183#action_12609183 ] 

Li Zhengji commented on COUCHDB-85:
-----------------------------------

Please review my resolution. 

all_databases() ->
	{ok, Root} = gen_server:call(couch_server, get_root),
	DbNameStart = string:len(Root) + 1,
	Filenames = 
	filelib:fold_files(Root, "^[a-z0-9\\_\\$()\\+\\-]*[\\.]couch$", true,
		fun(Filename, AccIn) ->
			case string:substr(Filename, DbNameStart) of
			[$/ | RelativeFilename] -> ok;
			RelativeFilename -> ok
			end,
			[filename:rootname(RelativeFilename, ".couch") | AccIn]
		end, []),
	{ok, Filenames}.

> couch_server:all_databases() does not work on file name case-insensitive OS, such as Windows.
> ---------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-85
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-85
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 0.8
>         Environment: Windows XP, 	Erlang/OTP R12B-3
>            Reporter: Li Zhengji
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> "Filename -- Root": the "--" here will not work as we want obviously. For example, Filename = "e:/aa.couch", Root = "E:/", then (Filename -- Root) = "eaa.couch". Not to say "/" and "\" on Windows.  
> "--" should not be used here. The simple way to do this would be: delete(FileName, 1, length(Root)).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (COUCHDB-85) couch_server:all_databases() does not work on file name case-insensitive OS, such as Windows.

Posted by "Li Zhengji (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/COUCHDB-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Li Zhengji updated COUCHDB-85:
------------------------------

    Component/s: Database Core

> couch_server:all_databases() does not work on file name case-insensitive OS, such as Windows.
> ---------------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-85
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-85
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core
>    Affects Versions: 0.8
>         Environment: Windows XP, 	Erlang/OTP R12B-3
>            Reporter: Li Zhengji
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> "Filename -- Root": the "--" here will not work as we want obviously. For example, Filename = "e:/aa.couch", Root = "E:/", then (Filename -- Root) = "eaa.couch". Not to say "/" and "\" on Windows.  
> "--" should not be used here. The simple way to do this would be: delete(FileName, 1, length(Root)).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.