Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #1668 - make existsCaseSensitive work for directories #1713

Merged

Conversation

crucialfelix
Copy link
Member

tested on a case insensitive file system using this:
var pathName = "/Users/crucial/Library/Application Support/SuperCollider/downloaded-quarks/splines";
(pathName.dirname+/+"*").pathMatch.detect{|x|x.withoutTrailingSlash.compare(pathName.withoutTrailingSlash)==0}.notNil

tested on a case insensitive file system using this:
var pathName = "/Users/crucial/Library/Application Support/SuperCollider/downloaded-quarks/splines";
(pathName.dirname+/+"*").pathMatch.detect{|x|x.withoutTrailingSlash.compare(pathName.withoutTrailingSlash)==0}.notNil
@crucialfelix
Copy link
Member Author

To test this fix you can compare:

set pathName to an existing directory

previously returns false

var pathName = "/Users/crucial/Library/Application Support/SuperCollider/downloaded-quarks/splines";
(pathName.dirname+/+"*").pathMatch.detect{|x|x.compare(pathName)==0}.notNil

with the fix it returns true

var pathName = "/Users/crucial/Library/Application Support/SuperCollider/downloaded-quarks/splines";
// if the input has a trailing slash its still fine
// var pathName = "/Users/crucial/Library/Application Support/SuperCollider/downloaded-quarks/splines/";
(pathName.dirname+/+"*").pathMatch.detect{|x|x.withoutTrailingSlash.compare(pathName.withoutTrailingSlash)==0}.notNil

crucialfelix added a commit that referenced this pull request Nov 7, 2015
fix #1668 - make existsCaseSensitive work for directories
@crucialfelix crucialfelix merged commit 8ce950e into supercollider:master Nov 7, 2015
@crucialfelix crucialfelix deleted the topic/exists-case-sensitive branch December 6, 2015 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant