在 SAP ABAP 中创建文件时如何设置(unix)权限?

发布于 2024-07-08 20:24:31 字数 302 浏览 5 评论 0原文

你可能会认为这是显而易见的,但通过文档、SAP 论坛、谷歌搜索等进行搜索,我却一无所获。 我使用以下代码在Solaris文件系统上的ABAP中创建一个文件:

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

生成的文件根据预定义的管理员用户拥有和分组,这很好,但粘性的检票口是权限设置为660/ rw-rw----,这意味着我无法检查结果。 有没有办法(可能使用模糊定义的类型添加?)我可以指定新文件的最终权限?

谢谢!

you would think this would be obvious, but searching through documentation, SAP forums, Googling, etc., I've been spectacularly unsuccessful. I'm creating a file in ABAP on a solaris filesystem using the following code:

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.

the resulting file is owned and grouped according to a pre-defined admin user, which is fine, but the sticky wicket is that the permissions are set to 660/rw-rw----, meaning I can't examine the results. is there a way (possibly using that vaguely defined TYPE addition?) I can specify the resulting permissions on the new file?

thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

紫轩蝶泪 2024-07-15 20:24:31

转到SM69,创建一个逻辑系统命令,您可以将其称为ZCHMOD。

将该命令映射到 chmod,然后使用正确的参数进行调用
(命令行上的 man chmod 是你的朋友)。

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
    commandname                   = 'ZCHMOD'
    additional_parameters         = l_par
    operatingsystem               = l_os
  TABLES
    exec_protocol                 = it_log
  EXCEPTIONS
    no_permission                 = 1
    command_not_found             = 2
    parameters_too_long           = 3
    security_risk                 = 4
    wrong_check_call_interface    = 5
    program_start_error           = 6
    program_termination_error     = 7
    x_error                       = 8
    parameter_expected            = 9
    too_many_parameters           = 10
    illegal_command               = 11
    wrong_asynchronous_parameters = 12
    cant_enq_tbtco_entry          = 13
    jobcount_generation_error     = 14
    OTHERS                        = 15.

显然,这将是一个两步过程,但它确实有效。

Go to SM69, create a logical system command, you could call it ZCHMOD.

Map that command to chmod, then call with the proper parameter
(man chmod on the command line is your friend).

CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
  EXPORTING
    commandname                   = 'ZCHMOD'
    additional_parameters         = l_par
    operatingsystem               = l_os
  TABLES
    exec_protocol                 = it_log
  EXCEPTIONS
    no_permission                 = 1
    command_not_found             = 2
    parameters_too_long           = 3
    security_risk                 = 4
    wrong_check_call_interface    = 5
    program_start_error           = 6
    program_termination_error     = 7
    x_error                       = 8
    parameter_expected            = 9
    too_many_parameters           = 10
    illegal_command               = 11
    wrong_asynchronous_parameters = 12
    cant_enq_tbtco_entry          = 13
    jobcount_generation_error     = 14
    OTHERS                        = 15.

Obviously, that would be a 2 step process, but it works.

我喜欢麦丽素 2024-07-15 20:24:31

这适用于 4.6B:

        CONCATENATE 'chmod ugo=rw ' lc_filename
          INTO lc_chmod SEPARATED BY space.
        CALL 'SYSTEM' ID 'COMMAND' FIELD lc_chmod.

希望这会有所帮助。

干杯,
平子

this works in 4.6B:

        CONCATENATE 'chmod ugo=rw ' lc_filename
          INTO lc_chmod SEPARATED BY space.
        CALL 'SYSTEM' ID 'COMMAND' FIELD lc_chmod.

Hope this helps.

Cheers,
Heiko

£冰雨忧蓝° 2024-07-15 20:24:31

在RZ10中添加参数install/umask
默认值为 007,您可以更改它:000、002...
因此,创建的文件将为 -rw-rw-rw-、-rw-rw-r--...

In RZ10 add parameter install/umask.
Default value is 007, you can change it: 000, 002...
So, the files created will be -rw-rw-rw-, -rw-rw-r--...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文