s3fs-fuse/test/mergedir.sh

198 lines
5.4 KiB
Bash
Raw Permalink Normal View History

Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
#!/bin/sh
#
# s3fs - FUSE-based file system backed by Amazon S3
#
# Copyright 2007-2008 Randy Rizun <rrizun@gmail.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
#
# Merge old directory object to new.
# For s3fs after v1.64
#
###
### UsageFunction <program name>
###
2019-01-27 12:04:29 +00:00
UsageFunction()
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
{
echo "Usage: $1 [-h] [-y] [-all] <base directory>"
echo " -h print usage"
echo " -y no confirm"
2019-01-27 12:04:29 +00:00
echo " -all force all directories"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo " There is no -all option is only to merge for other S3 client."
echo " If -all is specified, this shell script merge all directory"
echo " for s3fs old version."
echo ""
}
### Check parameters
WHOAMI=$(whoami)
OWNNAME=$(basename "$0")
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
AUTOYES="no"
ALLYES="no"
DIRPARAM=""
while [ "$1" != "" ]; do
if [ "X$1" = "X-help" ] || [ "X$1" = "X-h" ] || [ "X$1" = "X-H" ]; then
UsageFunction "${OWNNAME}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
exit 0
elif [ "X$1" = "X-y" ] || [ "X$1" = "X-Y" ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
AUTOYES="yes"
elif [ "X$1" = "X-all" ] || [ "X$1" = "X-ALL" ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
ALLYES="yes"
else
if [ "X$DIRPARAM" != "X" ]; then
echo "*** Input error."
echo ""
UsageFunction "${OWNNAME}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
exit 1
fi
DIRPARAM=$1
fi
shift
done
if [ "X$DIRPARAM" = "X" ]; then
echo "*** Input error."
echo ""
UsageFunction "${OWNNAME}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
exit 1
fi
if [ "$WHOAMI" != "root" ]; then
echo ""
echo "Warning: You run this script by $WHOAMI, should be root."
echo ""
fi
### Caution
echo "#############################################################################"
echo "[CAUTION]"
echo "This program merges a directory made in s3fs which is older than version 1.64."
2019-01-27 12:04:29 +00:00
echo "And made in other S3 client application."
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo "This program may be have bugs which are not fixed yet."
echo "Please execute this program by responsibility of your own."
echo "#############################################################################"
echo ""
DATE=$(date +'%Y%m%d-%H%M%S')
LOGFILE="${OWNNAME}-${DATE}.log"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo "Start to merge directory object... [${DIRPARAM}]"
{
echo "# Start to merge directory object... [${DIRPARAM}]"
echo "# DATE : $(date)"
echo "# BASEDIR : $(pwd)"
echo "# TARGET PATH : ${DIRPARAM}"
echo ""
} > "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
if [ "$AUTOYES" = "yes" ]; then
echo "(no confirmation)"
else
echo ""
fi
echo ""
### Get Directory list
DIRLIST=$(find "${DIRPARAM}" -type d -print | grep -v ^\.$)
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
#
# Main loop
#
for DIR in $DIRLIST; do
### Skip "." and ".." directories
BASENAME=$(basename "${DIR}")
if [ "${BASENAME}" = "." ] || [ "${BASENAME}" = ".." ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
continue
fi
if [ "${ALLYES}" = "no" ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
### Skip "d---------" directories.
### Other clients make directory object "dir/" which don't have
2019-01-27 12:04:29 +00:00
### "x-amz-meta-mode" attribute.
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
### Then these directories is "d---------", it is target directory.
# shellcheck disable=SC2012
DIRPERMIT=$(ls -ld --time-style=+'%Y%m%d%H%M' "${DIR}" | awk '{print $1}')
if [ "${DIRPERMIT}" != "d---------" ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
continue
fi
fi
2019-01-27 12:04:29 +00:00
### Confirm
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
ANSWER=""
if [ "${AUTOYES}" = "yes" ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
ANSWER="y"
fi
while [ "X${ANSWER}" != "XY" ] && [ "X${ANSWER}" != "Xy" ] && [ "X${ANSWER}" != "XN" ] && [ "X${ANSWER}" != "Xn" ]; do
printf "%s" "Do you merge ${DIR} ? (y/n): "
read -r ANSWER
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
done
if [ "X${ANSWER}" != "XY" ] && [ "X${ANSWER}" != "Xy" ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
continue
fi
### Do
# shellcheck disable=SC2012
CHOWN=$(ls -ld --time-style=+'%Y%m%d%H%M' "${DIR}" | awk '{print $3":"$4" "$7}')
# shellcheck disable=SC2012
CHMOD=$(ls -ld --time-style=+'%Y%m%d%H%M' "${DIR}" | awk '{print $7}')
# shellcheck disable=SC2012
TOUCH=$(ls -ld --time-style=+'%Y%m%d%H%M' "${DIR}" | awk '{print $6" "$7}')
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
printf "%s" "*** Merge ${DIR} : "
printf "%s" " ${DIR} : " >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
chmod 755 "${CHMOD}" > /dev/null 2>&1
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
RESULT=$?
if [ "${RESULT}" -ne 0 ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo "Failed(chmod)"
echo "Failed(chmod)" >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
continue
fi
chown "${CHOWN}" > /dev/null 2>&1
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
RESULT=$?
if [ "${RESULT}" -ne 0 ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo "Failed(chown)"
echo "Failed(chown)" >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
continue
fi
touch -t "${TOUCH}" > /dev/null 2>&1
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
RESULT=$?
if [ "${RESULT}" -ne 0 ]; then
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo "Failed(touch)"
echo "Failed(touch)" >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
continue
fi
echo "Succeed"
echo "Succeed" >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
done
echo ""
echo "" >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
echo "Finished."
echo "# Finished : $(date)" >> "${LOGFILE}"
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
#
# Local variables:
# tab-width: 4
# c-basic-offset: 4
# End:
# vim600: expandtab sw=4 ts=4 fdm=marker
# vim<600: expandtab sw=4 ts=4
Summary of Changes(1.63 -> 1.64) * This new version was made for fixing big issue about directory object. Please be careful and review new s3fs. ========================== List of Changes ========================== 1) Fixed bugs Fixed some memory leak and un-freed curl handle. Fixed codes with a bug which is not found yet. Fixed a bug that the s3fs could not update object's mtime when the s3fs had a opened file descriptor. Please let us know a bug, when you find new bug of a memory leak. 2) Changed codes Changed codes of s3fs_readdir() and list_bucket() etc. Changed codes so that the get_realpath() function returned std::string. Changed codes about exit() function. Because the exit() function is called from many fuse callback function directly, these function called fuse_exit() function and retuned with error. Changed codes so that the case of the characters for the "x-amz-meta" response header is ignored. 3) Added a option Added the norenameapi option for the storage compatible with S3 without copy API. This option is subset of nocopyapi option. Please read man page or call with --help option. 4) Object for directory This is very big and important change. The object of directory is changed "dir/" instead of "dir" for being compatible with other S3 client applications. And this version understands the object of directory which is made by old version. If the new s3fs changes the attributes or owner/group or mtime of the directory object, the s3fs automatically changes the object from old object name("dir") to new("dir/"). If you need to change old object name("dir") to new("dir/") manually, you can use shell script(mergedir.sh) in test directory. * About the directory object name AWS S3 allows the object name as both "dir" and "dir/". The s3fs before this version understood only "dir" as directory object name, but old version did not understand the "dir/" object name. The new version understands both of "dir" and "dir/" object name. The s3fs user needs to be care for the special situation that I mentioned later. The new version deletes old "dir" object and makes new "dir/" object, when the user operates the directory object for changing the permission or owner/group or mtime. This operation does on background and automatically. If you need to merge manually, you can use shell script which is mergedir.sh in test directory. This script runs chmod/chown/touch commands after finding a directory. Other S3 client application makes a directory object("dir/") without meta information which is needed to understand by the s3fs, this script can add meta information for a directory object. If this script function is insufficient for you, you can read and modify the codes by yourself. Please use the shell script carefully because of changing the object. If you find a bug in this script, please let me know. * Details ** The directory object made by old version The directory object made by old version is not understood by other S3 client application. New s3fs version was updated for keeping compatibility with other clients. You can use the mergedir.sh in test directory for merging from old directory object("dir") to new("dir/"). The directory object name is changed from "dir" to "dir/" after the mergedir.sh is run, this changed "dir/" object is understood by other S3 clients. This script runs chmod/chown/chgrp/touch/etc commands against the old directory object("dir"), then new s3fs merges that directory automatically. If you need to change directory object from old to new manually, you can do it by running these commands which change the directory attributes(mode/owner/group/mtime). ** The directory object made by new version The directory object name made by new version is "dir/". Because the name includes "/", other S3 client applications understand it as the directory. I tested new directory by s3cmd/tntDrive/DragonDisk/Gladinet as other S3 clients, the result was good compatibility. You need to know that the compatibility has small problem by the difference in specifications between clients. And you need to be careful about that the old s3fs can not understand the directory object which made by new s3fs. You should change all s3fs which accesses same bucket. ** The directory object made by other S3 client application Because the object is determined as a directory by the s3fs, the s3fs makes and uses special meta information which is "x-amz-meta-***" and "Content-Type" as HTTP header. The s3fs sets and uses HTTP headers for the directory object, those headers are listed below. Content-Type: application/x-directory x-amz-meta-mode: <mode> x-amz-meta-uid: <UID> x-amz-meta-gid <GID> x-amz-meta-mtime: <unix time of modified file> Other S3 client application builds the directory object without attributes which is needed by the s3fs. When the "ls" command is run on the s3fs-fuse file system which has directories/files made by other S3 clients, this result is shown below. d--------- 1 root root 0 Feb 27 11:21 dir ---------- 1 root root 1024 Mar 14 02:15 file Because the objects don't have meta information("x-amz-meta-mode"), it means mode=0000. In this case, the directory object is shown only "d", because the s3fs determines the object as a directory when the object is the name with "/" or has "Content-type: application/x-directory" header. (The s3fs sets "Content-Type: application/x-directory" to the directory object, but other S3 clients set "binary/octet-stream".) In that result, nobody without root is allowed to operate the object. The owner and group are "root"(UID=0) because the object doesn't have "x-amz-meta-uid/gid". If the object doesn't have "x-amz-meta-mtime", the s3fs uses "Last-Modified" HTTP header. Therefore the object's mtime is "Last-Modified" value.(This logic is same as old version) It has been already explained, if you need to change the object attributes, you can do it by manually operation or mergedir.sh. * Example of the compatibility with s3cmd etc ** Case A) Only "dir/file" object One of case, there is only "dir/file" object without "dir/" object, that object is made by s3cmd or etc. In this case, the response of REST API(list bucket) with "delimiter=/" parameter has "CommonPrefixes", and the "dir/" is listed in "CommonPrefixes/Prefix", but the "dir/" object is not real object. The s3fs needs to determine this object as directory, however there is no real directory object("dir" or "dir/"). But both new s3fs and old one does NOT understand this "dir/" in "CommonPrefixes", because the s3fs fails to get meta information from "dir" or "dir/". On this case, the result of "ls" command is shown below. ??????????? ? ? ? ? ? dir This "dir" is not operated by anyone and any process, because the s3fs does not understand this object permission. And "dir/file" object can not be shown and operated too. Some other S3 clients(tntDrive/Gladinet/etc) can not understand this object as same as the s3fs. If you need to operate "dir/file" object, you need to make the "dir/" object as a directory. To make the "dir/" directory object, you need to do below. Because there is already the "dir" object which is not real object, you can not make "dir/" directory. (s3cmd does not make "dir/" object because the object name has "/".). You should make another name directory(ex: "dir2/"), and move the "dir/file" objects to in new directory. Last, you can rename the directory name from "dir2/" to "dir/". ** Case B) Both "dir" and "dir/file" object This case is that there are "dir" and "dir/file" objects which were made by s3cmd/etc. s3cmd and s3fs understand the "dir" object as normal(file) object because this object does not have meta information and a name with "/". But the result of REST API(list bucket) has "dir/" name in "CommonPrefixes/Prefix". The s3fs checks "dir/" and "dir" as a directory, but the "dir" object is not directory object. (Because the new s3fs need to compatible old version, the s3fs checks a directory object in order of "dir/", "dir") In this case, the result of "ls" command is shown below. ---------- 1 root root 0 Feb 27 02:48 dir As a result, the "dir/file" can not be shown and operated because the "dir" object is a file. If you determine the "dir" as a directory, you need to add mete information to the "dir" object by s3cmd. ** Case C) Both "dir" and "dir/" object Last case is that there are "dir" and "dir/" objects which were made by other S3 clients. (example: At first you upload a object "dir/" as a directory by new 3sfs, and you upload a object "dir" by s3cmd.) New s3fs determines "dir/" as a directory, because the s3fs searches in oder of "dir/", "dir". As a result, the "dir" object can not be shown and operated. ** Compatibility between S3 clients Both new and old s3fs do not understand both "dir" and "dir/" at the same time, tntDrive and Galdinet are same as the s3fs. If there are "dir/" and "dir" objects, the s3fs gives priority to "dir/". But s3cmd and DragonDisk understand both objects. git-svn-id: http://s3fs.googlecode.com/svn/trunk@392 df820570-a93a-0410-bd06-b72b767a4274
2013-03-23 14:04:07 +00:00
#