Skip to content

Instantly share code, notes, and snippets.

@ntata
Last active September 23, 2016 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ntata/34e6cf8178a29f5f4cb06d64d08cdcda to your computer and use it in GitHub Desktop.
Save ntata/34e6cf8178a29f5f4cb06d64d08cdcda to your computer and use it in GitHub Desktop.
########################################################
# object path containing a folder named semicolon (";")
########################################################
This is the folder structure where my object "obj" resides on my local machine:
f1
|_f2
|_";"
|_obj
#creating a container named "test_container"
swift@sandbox-nt:~$ swift post test_container
#uploading object "obj" into "test_container" using its absolute path
NOTE: swift will create the object and name it with the absolute path that we mention. this behaviour can be overrriden.
swift@sandbox-nt:~$ swift upload test_container f1/f2/";"/obj
f1/f2/;/obj --> name of the object
#making a folder to download "obj" and check if multiple folders are getting created
swift@sandbox-nt:~$ mkdir downloads
swift@sandbox-nt:~$ cd downloads/
#download "obj" by specifying its container name ("test_container") and the name of the object
swift@sandbox-nt:~/downloads$ swift download test_container f1/f2/;/obj
Object 'test_container/f1/f2/' not found (I forgot to add the quotes to the semicolon for shell to not ignore the the semicolon)
bash: /obj: No such file or directory
#trying again; SUCCESS
swift@sandbox-nt:~/downloads$ swift download test_container f1/f2/";"/obj
f1/f2/;/obj [auth 0.016s, headers 0.039s, total 0.039s, 0.000 MB/s]
swift@sandbox-nt:~/downloads$ ll
total 12
drwxrwxr-x 3 swift swift 4096 Sep 23 16:10 ./
drwxr-xr-x 11 swift swift 4096 Sep 23 16:09 ../
drwxrwxr-x 3 swift swift 4096 Sep 23 16:10 f1/
swift@sandbox-nt:~/downloads$ cd f1/f2/\;/
swift@sandbox-nt:~/downloads/f1/f2/;$ ll
total 12
drwxrwxr-x 2 swift swift 4096 Sep 23 16:10 ./
drwxrwxr-x 3 swift swift 4096 Sep 23 16:10 ../
-rw-rw-r-- 1 swift swift 4 Sep 23 16:01 obj
#############################################
# folder name ending with a semicolon
#############################################
folder structure:
"f3;"
|_f4
|_obj2
#successfully created the object "obj2" in "test_container"
swift@sandbox-nt:~$ swift upload test_container "f3;"/f4/obj2
f3;/f4/obj2
#download object "obj2"
swift@sandbox-nt:~$ cd downloads/
#trial 1 FAILED
swift@sandbox-nt:~/downloads$ swift download test_contaienr f3;/f4/obj2
Object 'test_contaienr/f3' not found
bash: /f4/obj2: No such file or directory
#trial2 SUCCESS
swift@sandbox-nt:~/downloads$ swift download test_contaienr "f3;"/f4/obj2
f3;/f4/obj2 [auth 0.013s, headers 0.033s, total 0.033s, 0.000 MB/s]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment