Creating a Folder
Scenarios
You can create a folder in a bucket to facilitate classification and management of data stored in OBS.
Unlike a file system, OBS does not involve the concepts of file and folder. For easy data management, OBS provides a method to simulate folders. On OBS Console or OBS Browser+, an object is simulated as a folder by adding a slash (/) to the end of the object name. When objects are listed by calling the API, the obtained object name is the path of the object, and the content following the last slash (/) is the actual object name. If the path ends with a slash (/), it indicates that the object is a folder. The hierarchical depth of the object does not affect the performance of accessing the object.
Ways to Create a Folder
You can use OBS Console, APIs, SDKs, OBS Browser+, or obsutil to create a folder.
Examples
- Take the Windows OS as an example. Run the obsutil mkdir obs://bucket-test/folder1/folder2 command to create a folder in a bucket.
obsutil mkdir obs://bucket-test/folder1/folder2 The bucket [bucket-test] does not support POSIX, create folder(s) step by step Create folder [obs://bucket-test/folder1/] successfully, request id [0000016979E1D23C860BB3D8E4577C5E] Create folder [obs://bucket-test/folder1/folder2] successfully, request id [0000016979E1D2B2860BB5181229C72C]
Parameter Description
Parameter |
Optional or Mandatory |
Description |
---|---|---|
bucket |
Mandatory when creating a folder in a specified bucket |
Bucket name |
folder |
Mandatory when creating a folder in a specified bucket |
Folder path in the bucket. This value can contain multi-level folders. Separate each level with a slash (/). |
folder_url |
Mandatory when creating a folder in the local file system |
Folder path in the local file system. The value can be an absolute path or a relative path. |
config |
Optional (additional parameter) |
User-defined configuration file for executing the current command. To learn the parameters that can be configured in this file, see Configuration Parameters. |
e |
Optional (additional parameter) |
Specifies the endpoint. |
i |
Optional (additional parameter) |
Specifies the user's AK. |
k |
Optional (additional parameter) |
Specifies the user's SK. |
t |
Optional (additional parameter) |
Specifies the user's security token. |
Follow-up Procedure
You can click Copy Path on the right to copy the path of the folder and share it with others. Then they can open the bucket where the folder is stored and enter the path in the search box above the object list to find the folder.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot