@@ -266,8 +266,12 @@ pub type FileInfo {
266266/// ```
267267///
268268@ deprecated ( "Use the simplifile package instead" )
269+ pub fn file_info ( a : String ) -> Result ( FileInfo , Reason ) {
270+ do_file_info ( a )
271+ }
272+
269273@ external ( erlang , "gleam_erlang_ffi" , "file_info" )
270- pub fn file_info ( a : String ) -> Result ( FileInfo , Reason )
274+ fn do_file_info ( a : String ) -> Result ( FileInfo , Reason )
271275
272276/// Results in `FileInfo` about the given `path` on success, otherwise a
273277/// `Reason` for failure.
@@ -337,8 +341,12 @@ pub fn file_info(a: String) -> Result(FileInfo, Reason)
337341/// ```
338342///
339343@ deprecated ( "Use the simplifile package instead" )
344+ pub fn link_info ( a : String ) -> Result ( FileInfo , Reason ) {
345+ do_link_info ( a )
346+ }
347+
340348@ external ( erlang , "gleam_erlang_ffi" , "link_info" )
341- pub fn link_info ( a : String ) -> Result ( FileInfo , Reason )
349+ fn do_link_info ( a : String ) -> Result ( FileInfo , Reason )
342350
343351/// Results in a `Bool` on success that indicates whether the given `path` has
344352/// a `Directory` `FileType`, otherwise a `Reason` for failure.
@@ -360,7 +368,7 @@ pub fn link_info(a: String) -> Result(FileInfo, Reason)
360368///
361369@ deprecated ( "Use the simplifile package instead" )
362370pub fn is_directory ( path : String ) -> Result ( Bool , Reason ) {
363- use FileInfo ( file_type : file_type , .. ) <- result . map ( over : file_info ( path ) )
371+ use FileInfo ( file_type : file_type , .. ) <- result . map ( over : do_file_info ( path ) )
364372 file_type == Directory
365373}
366374
@@ -384,7 +392,7 @@ pub fn is_directory(path: String) -> Result(Bool, Reason) {
384392///
385393@ deprecated ( "Use the simplifile package instead" )
386394pub fn is_regular ( path : String ) -> Result ( Bool , Reason ) {
387- use FileInfo ( file_type : file_type , .. ) <- result . map ( over : file_info ( path ) )
395+ use FileInfo ( file_type : file_type , .. ) <- result . map ( over : do_file_info ( path ) )
388396 file_type == Regular
389397}
390398
@@ -414,7 +422,7 @@ pub fn is_regular(path: String) -> Result(Bool, Reason) {
414422pub fn file_exists ( path : String ) -> Result ( Bool , Reason ) {
415423 let result =
416424 path
417- |> file_info
425+ |> do_file_info
418426 |> result . replace ( True )
419427 case result {
420428 Error ( Enoent ) -> Ok ( False )
@@ -448,7 +456,7 @@ pub fn file_exists(path: String) -> Result(Bool, Reason) {
448456pub fn link_exists ( path : String ) -> Result ( Bool , Reason ) {
449457 let result =
450458 path
451- |> link_info
459+ |> do_link_info
452460 |> result . replace ( True )
453461 case result {
454462 Error ( Enoent ) -> Ok ( False )
0 commit comments