各种语言里获取当前模块的方法:ABAP,ABSL,C,nodejs
2023-09-14 09:02:48 时间
ABAP
sy-CPROG
ABSL
C
__FILE__用以指示本行语句所在源文件的文件名.
#include <stdio.h>
int main()
{
printf("%s\n",__FILE__);
}
vi另存为test.c, gcc编译生成a.out,执行后输出结果为:
test.c
__LINE__用以指示本行语句在源文件中的位置信息,
输出:
4
5
6
nodejs
webpack配置文件里随处可见这种全局变量__dirname的使用:
example:
running node example.js from /Users/mjr
console.log(__dirname);
// Prints: /Users/mjr
console.log(path.dirname(__filename));
// Prints: /Users/mjr
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- nodejs XML和json互相转换
- nodejs中的buffer
- nodejs的划时代意义,以及vue和nodejs的关系
- Atitit nlp自然语言处理类库(java python nodejs c#net) 目录 1.1. Python snownlp1 1.2. NLP.js一个nodejs/javascri
- Atitit 架构师的技术框架体系图 各种引擎列表 脚本引擎 groovy beanshel php nodejs rhino等 表达式引擎技术 Ognl/MVELl等 通讯, rest 命令解
- nodejs,python,sublime和Eclipse的包管理器
- nodejs --inspect-brk结合Chrome开发者工具的调试
- 在nodejs环境里使用浏览器环境下的document对象
- nodejs里fs.readFile的相对路径转绝对路径问题
- 如何把nodejs应用和SAP云平台上的Redis实例做绑定
- 【nodejs】使用 npm安装模块方法
- NodeJs——(14)express框架的send()方法简介
- 【nodejs原理&源码赏析(1)】Express中间件系统的基本实现
- nodejs之处理GET请求
- Coinhive挖矿脚本分析与Pool改造自建——这篇文章说浏览器挖矿,后端nodejs本质上就是代理!!!的确如此!!!
- nodejs之querystring模块