Chromium Code Reviews| Index: base/file_util.h |
| diff --git a/base/file_util.h b/base/file_util.h |
| index 6cc13f021b772f2f7fe6fb1d3747f2422713a141..f957557cc7672ed6111752b062983fc6f169f638 100644 |
| --- a/base/file_util.h |
| +++ b/base/file_util.h |
| @@ -101,7 +101,7 @@ BASE_EXPORT int64 ComputeFilesSize(const FilePath& directory, |
| // Returns true if successful, false otherwise. |
| // |
| // In posix environment and if |path| is a symbolic link, this deletes only |
| -// the symlink. (even if the symlink deferences to a non-existent file) |
| +// the symlink. (even if the symlink point to a non-existent file) |
| // |
| // WARNING: USING THIS WITH recursive==true IS EQUIVALENT |
| // TO "rm -rf", SO USE WITH CAUTION. |
| @@ -196,6 +196,34 @@ BASE_EXPORT bool CreateSymbolicLink(const FilePath& target, |
| // Reads the given |symlink| and returns where it points to in |target|. |
| // Returns false upon failure. |
| BASE_EXPORT bool ReadSymbolicLink(const FilePath& symlink, FilePath* target); |
| + |
| +// Bits ans masks of the file permission. |
| +enum FilePermissionBits { |
| + FILE_PERMISSION_MASK = S_IRWXU | S_IRWXG | S_IRWXO, |
| + FILE_PERMISSION_USER_MASK = S_IRWXU, |
| + FILE_PERMISSION_GROUP_MASK = S_IRWXG, |
| + FILE_PERMISSION_OTHERS_MASK = S_IRWXO, |
| + |
| + FILE_PERMISSION_READ_BY_USER = S_IRUSR, |
| + FILE_PERMISSION_WRITE_BY_USER = S_IWUSR, |
| + FILE_PERMISSION_EXECUTE_BY_USER = S_IXUSR, |
| + FILE_PERMISSION_READ_BY_GROUP = S_IRGRP, |
| + FILE_PERMISSION_WRITE_BY_GROUP = S_IWGRP, |
| + FILE_PERMISSION_EXECUTE_BY_GROUP = S_IXGRP, |
| + FILE_PERMISSION_READ_BY_OTHERS = S_IROTH, |
| + FILE_PERMISSION_WRITE_BY_OTHERS = S_IWOTH, |
| + FILE_PERMISSION_EXECUTE_BY_OTHERS = S_IXOTH, |
| +}; |
| + |
| +// Reads the permission of the given |path|, storing the file permission |
| +// bits in |mode|. If |path| is symbolic link, |mode| is the permission of |
| +// a file which the symlink point to. |
| +BASE_EXPORT bool GetPosixFilePermissions(const FilePath& path, |
| + int* mode); |
| +// Sets the permission of the given |path|. If |path| is symbolic link, sets |
| +// the permission of a file which the symlink point to. |
|
satorux1
2012/07/10 06:57:17
points
yoshiki
2012/07/10 18:51:36
Done.
|
| +BASE_EXPORT bool SetPosixFilePermissions(const FilePath& path, |
| + int mode); |
| #endif // defined(OS_POSIX) |
| #if defined(OS_WIN) |