123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <!DOCTYPE html>
- <html lang="en-US">
- <head>
- <title>SlideScript API: File manipulation ~ The Lazy Language</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
- <meta name="viewport" content="width=device-width, initial-scale=1" />
- <meta name="description" content="SlideScript API and Documentation section - SlideScript is a micro stripting language with the intent to give the world an effective shell like experience with the ability to use a sloppy syntax! SlideScript can do simple every day shell tasks like manipulating and working with files, and directories, piping, variable support, and backquoting, with a bit of spice like: built-in md5, and encoder / decoder, webserver, networking functions, tar and compression functions, PLUS MORE!" />
- <link href="../style.css" rel="stylesheet" type="text/css" />
- </head>
- <body>
- <table><tr><td>
- <div class="header">
- <img src="../sslogo.png" class="logoimg" title="SlideScript logo" alt="SlideScript" />
- </div>
- </td></tr><tr><td>
- <div class="menu"><!--
- --><a href="../index.html">Home</a><!--
- --><a href="index.html">Documentation</a><!--
- --><a href="https://notabug.org/Pentium44/slidescript">Git</a><!--
- --></div>
- </td></tr></table>
-
- <div class="container">
- <p>If you're following through the API documentation, chapter by chapter,
- then you have a good idea of the foundation of the language in terms
- of it's structure. Now for some features of SlideScript. File manipulation
- is definitely something that can be tackled without a doubt. A selection
- of functions within SlideScript that are file related are: isfile, isdir,
- showdir (ls), showpath (pwd), move (mv), delete, chdir (cd), read, write,
- and cat.<br /><br />
- To be honest, how could SlideScript be shell like without having the
- functionality of all the system utilities. Here's the kicker, everything
- is built-in to the core of SlideScript, making it extremely versatile and
- super simple! No dependency on other software!
- <pre><code>
- #!/usr/bin/slidescript
- # File manipulation examples
- # showdir: list directories/files in current directory.
- # argument count: 0
- # returns: file list.
- showdir
- ls # alias
- # showpath: show current working directory location (alias pwd).
- # argument count: 0
- # returns: working directory path
- showpath
- pwd # alias
- # chdir: Change directory
- # argument count: 1, "path" ex: "docs/"; "/home/user"
- # returns: No return
- chdir "docs/"
- showpath # Show return of change
- # backdir: Back a directory / to parent directory (same as chdir "..")
- # argument count: 0
- # returns: No return
- backdir
- # isdir / isfile: Return true or false (0 or 1) on file / directory find.
- # argument count: 1, "file/path" ex: "docs/README.txt"
- # returns: true / false
- isfile "docs/README.txt" # returns: true
- isdir "docs/" # returns: true
- isfile "docs/" # returns: false
- # move: move file / rename file based on arguments.
- # argument count: 2, "original" "new file name/location", ex: "docs/" "documents/"
- # returns: no return
- move "docs" "documents" # renamed docs -> documents
- # delete: delete file (non-recursive)
- # argument count: 1, "filename", ex: "docs/README.txt"
- # return: no return
- delete "docs/README.txt" # deletes README.txt inside docs/
- # read: read contents of file given to function
- # argument count: 1, "file", ex: "docs/README.txt"
- # return: contents of file
- read "docs/README.txt" # Returns contents of "README.txt"
- # write: write contents to file.
- # argument count: 2, "filename" "contents", ex: "test.txt" "Hello world!"
- # return: no return
- write "test.txt" "Hello world!"
- # cat: catenate file with given contents
- # argument count: 2, "file" "contents", ex: "test.txt" "I'm back!"
- # return: no return
- cat "test.txt" "I'm back!" # catenates "I'm back!" to the end of the original test.txt "Hello world!"
- # Ending file contents of "test.txt":
- # Hello world!
- # I'm back!
- </code></pre>
- </p>
-
- <h3>IRC server</h3>
- <p>
- Still need help? Want to report a bug? Join us!<br /><br />
- IP/Port: cddo.cc/1337<br />
- Main hang channel: <b>#theroot</b><br />
- FreeBox channel: <b>#freebox</b><br />
- FreonLinux channel: <b>#freonlinux</b>
- </p>
- </div>
- <div class="footer">
- © Chris Dorman, 2021 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode">CC BY-NC-SA 4.0</a> - Software GPLv2 licensed<br />
- <p>
- Powered by:<br />
- <a href="https://freedns.afraid.org/">
- <img style="width:100px;" src="https://freedns.afraid.org/images/freedns_crop.png" />
- </a>
- <a href="https://letsencrypt.org/">
- <img style="width: 100px;" src="https://letsencrypt.org/images/le-logo-wide.png" />
- </a>
- <a href="http://jigsaw.w3.org/css-validator/check/referer">
- <img style="border:0;width:80px" src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS!" />
- </a>
- </p>
- </div>
- </body>
- </html>
|