Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
e4d2045e
Commit
e4d2045e
authored
4 years ago
by
Andre Maroneze
Browse files
Options
Downloads
Patches
Plain Diff
[Filepath] add special_stdout notation (-)
parent
52b1d260
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libraries/utils/filepath.ml
+9
-2
9 additions, 2 deletions
src/libraries/utils/filepath.ml
src/libraries/utils/filepath.mli
+5
-0
5 additions, 0 deletions
src/libraries/utils/filepath.mli
with
14 additions
and
2 deletions
src/libraries/utils/filepath.ml
+
9
−
2
View file @
e4d2045e
...
...
@@ -267,10 +267,17 @@ module Normalized = struct
if
case_sensitive
then
String
.
compare
s1
s2
else
Extlib
.
compare_ignore_case
s1
s2
let
pretty
fmt
p
=
Format
.
fprintf
fmt
"%s"
(
pretty
p
)
let
pp_abs
fmt
p
=
Format
.
fprintf
fmt
"%s"
p
let
unknown
=
normalize
""
let
is_unknown
fp
=
equal
fp
unknown
let
special_stdout
=
normalize
"-"
let
is_special_stdout
fp
=
equal
fp
special_stdout
let
pretty
fmt
p
=
if
is_special_stdout
p
then
Format
.
fprintf
fmt
"<stdout>"
else
Format
.
fprintf
fmt
"%s"
(
pretty
p
)
let
pp_abs
fmt
p
=
Format
.
fprintf
fmt
"%s"
p
let
is_file
fp
=
try
(
Unix
.
stat
(
fp
:>
string
))
.
Unix
.
st_kind
=
Unix
.
S_REG
...
...
This diff is collapsed.
Click to expand it.
src/libraries/utils/filepath.mli
+
5
−
0
View file @
e4d2045e
...
...
@@ -156,6 +156,11 @@ module Normalized: sig
(** @since 20.0-Calcium *)
val
is_unknown
:
t
->
bool
(** [is_special_stdout f] returns [true] iff [f] is '-' (a single dash),
which is a special notation for 'stdout'.
@since Frama-C+dev *)
val
is_special_stdout
:
t
->
bool
(** [is_file f] returns [true] iff [f] points to a regular file
(or a symbolic link pointing to a file).
Returns [false] if any errors happen when [stat]'ing the file.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment