Posted 06 October 2013 - 06:25 PM
Simple File ManGet
What is it?
Spoiler
This is a simple API that allows novice programmers to modify, and retrieve files.How is this better than:
shell.run("pastebin get CODE_HERE FILE_HERE")
That's slower.
Download:
Spoiler
pastebin get 0m5KDuvr file
How to use / Functions in the API:
Get Files
Spoiler
file.get( pastebin_code , file_name )
This will save the pastebin program to the specified file without a GUI.
Get Many Files
Spoiler
file.getMany( {pastebin_code_1, pastebin_code_2, etc.}, {file_name_1, file_name_2, etc.} )
This allows you to get many pastebin programs at once, again, without a GUI.
Get File From Raw URL
Spoiler
file.getRaw( url, file )
This will take the URL provided, and put it's contents into a file.
Append to file
Spoiler
file.append( file_name, text, [no_end_of_line_character] )
This will add text to the end of a file, and if no_end_of_line_character is present, it will NOT put an end of line character (new line)
Read a Book!
Spoiler
file.read( file_name, read_all_of_the_file )
This will return a string containing a line (or all) of the file.
if read_all_of_the_file is present, the string returned will include the entire file WITHOUT end of line characters!, otherwise it will return the next line of the file without end of line characters.
ToDO
Add readMany function that will read, and return a certain amount of lines.
Thanks! Have a great day!