使用 fortran open 语句时处理语法错误
dispose syntax error when using fortran open statement
我正在打开一个文件,最后必须将其删除。以下命令抱怨使用 dispose
.
f = "espy.tmp"; h = "formatted"; r = "read"
Open (newunit=u, file=f, form=h, action=r, &
status="old", dispose="delete")
lib/core.f:177:21:
status="old", dispose="delete")
1
Error: Syntax error in OPEN statement at (1)
Dispose
是一个 non-standard compiler extension (and not supported by your compiler). As described in this answer,执行此操作的标准方法是在关闭时删除文件:
f = "espy.tmp"; h = "formatted"; r = "read"
Open (newunit=u, file=f, form=h, action=r, &
status="old")
close(u, status='delete')
或者,您可以使用 temporary/scratch 个文件(无文件名):
f = "espy.tmp"; h = "formatted"; r = "read"
Open (newunit=u, form=h, action=r, &
status="old", status='scratch')
我正在打开一个文件,最后必须将其删除。以下命令抱怨使用 dispose
.
f = "espy.tmp"; h = "formatted"; r = "read"
Open (newunit=u, file=f, form=h, action=r, &
status="old", dispose="delete")
lib/core.f:177:21:
status="old", dispose="delete")
1
Error: Syntax error in OPEN statement at (1)
Dispose
是一个 non-standard compiler extension (and not supported by your compiler). As described in this answer,执行此操作的标准方法是在关闭时删除文件:
f = "espy.tmp"; h = "formatted"; r = "read"
Open (newunit=u, file=f, form=h, action=r, &
status="old")
close(u, status='delete')
或者,您可以使用 temporary/scratch 个文件(无文件名):
f = "espy.tmp"; h = "formatted"; r = "read"
Open (newunit=u, form=h, action=r, &
status="old", status='scratch')