Methods to get current modules in various languages: ABAP, absl, C, nodejs

Time:2021-7-3

ABAP

sy-CPROG

ABSL

Methods to get current modules in various languages: ABAP, absl, C, nodejs

C

__ FILE__ Used to indicate the file name of the source file where the line statement is located

include <stdio.h>

int main()
{
printf(“%sn”,__FILE__);
}
VI is saved as test. C, and GCC compiles to generate a.out
test.c
__ LINE__ Used to indicate the location information of the line statement in the source file,

Methods to get current modules in various languages: ABAP, absl, C, nodejs

Output:
4
5
6

nodejs

This kind of global variable can be seen everywhere in the webpack configuration file__ Use of dirname:

Methods to get current modules in various languages: ABAP, absl, C, nodejs

example:
running node example.js from /Users/mjr

console.log(__dirname);
// Prints: /Users/mjr
console.log(path.dirname(__filename));
// Prints: /Users/mjr

For more original articles on Jerry, please pay attention to the official account of “Wang Zixi”:
Methods to get current modules in various languages: ABAP, absl, C, nodejs

Recommended Today

Build HTTP service with C + + Mongoose

Mongoose source code address:https://github.com/cesanta/mo… Mongoose user manual:https://www.cesanta.com/devel… Mngoose set up HTTP service #include <string> #include “mongoose.h” using namespace std; static const char *s_http_port = “8000”; static void ev_handler(mg_connection *nc, int ev, void *ev_data) { struct http_message *hm = (struct http_message *) ev_data; if (ev == MG_EV_HTTP_REQUEST) { std::string uri; if (hm->uri.p && hm->uri.p[0] == ‘/’) […]