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

CloudFile returns different path to what is uploaded #158

Open
isaacabraham opened this issue Sep 8, 2016 · 2 comments · May be fixed by #161
Open

CloudFile returns different path to what is uploaded #158

isaacabraham opened this issue Sep 8, 2016 · 2 comments · May be fixed by #161

Comments

@isaacabraham
Copy link
Contributor

There's an issue on the CloudFile Azure implementation: -

let x = CloudFile.Upload("foo.txt", @"data\blah.txt")
x.Path = "data/Account.txt" // false
x.Path = "/mbraceuserdata/data/Account.txt" // true

Even worse, the following (correctly) returns false: -

CloudFile.Exists x.Path

There needs to be a decision made regarding the mbraceuserdata folder - what is it for and when is it used - always (undesirable) or as a default (acceptable). If the latter, then the generated CloudFileInfo should not always prepend the path with \mbraceuserData. If the former, then CloudFile.Upload should always upload to that container.

@isaacabraham
Copy link
Contributor Author

@eiriktsarpalis what are your thoughts on this?

@isaacabraham
Copy link
Contributor Author

isaacabraham commented Jun 1, 2017

Having dug around a bit more into this, I can see what the problem is.

cc: @mathias-brandewinder - TLDR: Always ensure that you start your paths (when uploading AND when getting CloudFileInfo) with /.

A combination of MBrace.Core and MBrace.Azure libraries do some "implicit" cleanup on paths when you upload files or get CloudFileInfos.

When you upload a file, if the path does not start with /, one is automatically added. Then, the first segment of the path is used as a container unless there is only one element in the path, in which case the "secret" $root container is used. I'm going to remove this latter logic - it's not well understood or known and kind of magic.

Then, when you create a CloudFileInfo, if you forget to put a leading / in the path, it inserts the /mbraceuserdata folder at the front. I have no idea what the reasoning behind this is (or the implications of removing it). If you put a / at the front, this doesn't happen at all.

@isaacabraham isaacabraham linked a pull request Jun 2, 2017 that will close this issue
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 a pull request may close this issue.

1 participant