How to create a new file by Mikrotik routers' scripting [closed] - file-io

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
How to create a new file by script on Mikrotik Routerboard (Router OS 6.30)?

UPDATE:
This solutions also does not work well. It seems to be impossible to create a file and edit (/file set) it during one script call. I have no idea why, but only working solution is to run special create script two times (first creates a file and second edits it).
This easy task took me long time to solve. There is no official way, only some ugly workarounds. The main idea is create a file using some export operation (or fetch from network operation) and then flush created file.
Another problem is that multiple commands in one script file somehow cannot use created file's identifier. So instead of:
/file print file=newFile; /file set newFile contents=""
you must use:
/file print file=newFile; /file set [find name="newFile"] contents=""
Notice that first command just exports list of all files and second one flushes its content.

Related

How to decompile a access database without starting/opening it? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
In our deployment chain we compress the access-database before sending it to the user.
As there where some troubles we want to decompile it too.
But unfortunately decompiling (as described here: How does one decompile and recompile a database application? ) seems to require to start/open the database.
As we deploy very frequently, I am searching for a way to decompile the database without opening/starting it.
Don't believe that you can de-compile without launching the application. (even from command line). The only possible approach would be to create a blank database and import everything. This I suppose could be automated, and the result would be a database that not been compiled. So, a import of all objects into a new blank database is a "possible" solution, but it would involve code to transfer objects into that new blank database. Not likely worth the effort, but is a possible. And one could also consider the save-as text to export all objects into a text file, and then re-build a new solution based on those text files (this is how source code control works with access, and thus even building from a GIT repository is possible).

Grab the latest updated file from the Amazon s3 bucket using file name as query and get the last modified or created file? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to grab a file from Amazon S3. There might be more than one file saved with same file name, for example:
file1.pdf
file-1.pdf
I want to grab the file which is modified or added most recently based on the file name.
Is there a way we could do this using Query Or any other way?
I am using VB.net.
Given your example filenames (file.jpg, file-1.jpg), your application would need to list the contents of the bucket and then determine which object is wishes to access. It would then access the object with the exact name (key).
Alternatively, you could use versioning, where objects with the same name are stored "on top of each other". That is, they all have the same name (key), but are assigned different versions. When you access the object, it will return the latest version by default. You can also specify a particular version you wish to access.
You can also specify different Lifecycle policies for versioned objects vs current versions.
Using versioning would likely be a much easier option than trying to maintain different filenames for different versions of a file.

How does a computer processes each and every command given to it? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
If I type in some command let be as simple as possible like print numbers from one to ten in BlueJ. Now since I have given a main command the computer processes the command and gives the output, but my question is how each and every number is printed by the computer is there any particular code integrated within the software of the computer which processes and prints each and every number each and every time the above code is ran?
This depends upon the operating system. Here are two approaches:
I. In eunuchs variants the command interpreter is just a program. There is nothing special about it except that it processes commands. For the most part, commands simply map to programs. If you type "xyx" the command interpreter searches for an executable (or script) named xyz to execute. An environmental variable "PATH" defines the directories to search for the file.
II. In the VMS system, the command interpreter resides in a protected area of the process address space. For an interactive process, the command interpreter sits in the background while a program is running. Commands are defined by a table. If you type XYZ, the command interpreter looks for the XYZ command, figures out what the options to that command are, and runs the appropriate program. The actual program could be ABC and it is even possible that the same command could invoke different programs, depending upon the options supplied.

Does Zerobrane provide an "include" mechanism? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
To Zerobrane users, since this is not a question on lua :
I use Zerobrane for editing lua programs that are to be used with LuaLatex. Very nice !
I make all tests there before using the developments in LuaLatex. So, at the beginning, the programs are run there. I need to tidy up this part, on ZeroBrane, by making files hierarchical, with a master file and slave files around.
Once again, it is a question about ZeroBrane, not about how I use the file within LuaLatex (I know enough about doFile, luaexec and co)
Does this exist ?
I saw PaulK passing by, if he could drop a line, it would be appreciated ...
An "include mechanism" as you call it is usually a language feature, not some feature of an IDE.
Lua provides various functions for running code from other files.
dofile, load, loadfile, require, ...
The most convenient and common is require which will find a file by its name in a given set of directories and execute its contents.
Read this:
https://www.lua.org/manual/5.3/manual.html#6.3
https://www.lua.org/pil/8.1.html
https://www.tutorialspoint.com/lua/lua_modules.htm

How do I embed a batch file in a vb program? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm trying to make a simple VB program. I just want it to embed into it a running batch program. I'm asking if there is a way to do that.
So to break it down could i take a batch file and embed it into the program.
So it would kind of be like this except its not two windows: http://gyazo.com/72652af4dfc04cd379ee11ed0de165e2
1) It's probably silly to have a separate .bat file if you can do everything you want directly in the VB program. Have you considered just incorporating the functionality directly in VB?
2) To run a separate .bat file from VB.Net, perhaps the easiest way is to use Process.start().
EXAMPLE: System.Diagnostics.Process.Start("c:\path\to\myfile.bat")
3) Finally, you can always a) create a text file (with a .bat suffix and your .bat commands) on the fly, then call "Process.Start()" on your dynamically-created .bat file.
PS:
I assume by "VB" you probably mean "VB.Net". If you mean "VB6", the API would be "Shell()". For example: Shell("c:\path\to\myfile.bat", vbHide).