Override File store path

14 views
Skip to first unread message

Dinesh Sriram

unread,
Apr 28, 2013, 4:37:25 PM4/28/13
to mog...@googlegroups.com
I see that MogileFS stores an uploaded file in the path like  http://127.0.0.1:7500/dev1/0/000/000/0000000025.fid
I was wondering if there is a way to autogenerate the file path if I know the Key of the uploaded file. By that I mean, is there a way to force MogileFS to store a file with a particular name under a specified directory (http://127.0.0.1:7500/dev1/test/test.txt) so that I could construct the file path without querying the MogileFS infrastructure?

Eric Wong

unread,
Apr 28, 2013, 4:51:22 PM4/28/13
to mog...@googlegroups.com
No. There would be several problems with that approach:

* directory limits vary between FSes
* path names can get too long for some FSes
* directory/filename clashes
* no guarantee that PUT is atomic on WebDAV servers (so users may see
in-progress data, not just new/old data)

And probably a other problems I haven't thought of, yet.

dormando

unread,
Apr 28, 2013, 11:23:15 PM4/28/13
to mog...@googlegroups.com
+1. if you don't want to query mogilefs to find the file, you can cache
the paths in memcached or similar: still very lightweight.
Reply all
Reply to author
Forward
0 new messages