File::...Native(3pm)

πŸ“¦
version 1.004 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– File::Spec::Native β€” the manual page, but make it a group chat πŸ’–

okay so this is File::Spec::Native(3pm) β€” a User Contributed Perl Documentation situation, bestie. buckle up, it's short but it's iconic. πŸŽ€


✨ NAME ✨

File::Spec::Native β€” it lets you use the native OS implementation of File::Spec from a subclass. yes really, that's the whole thing. slay. πŸ’…

🌸 VERSION 🌸

version 1.004 β€” she's stable, she's little, she's doing her best. πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

okay so listen, bestie, I'm gonna give you the exact code, no cap:

  # This serves little purpose on its own but can be useful in some situations

  # For example:
  use Path::Class 0.24;

  # convert foreign file type into native type
  # without having to know what the current OS is
  foreign_file(Win32 => $win32_path)->as_foreign("Native");

  # or to build a file-spec dynamically (possibly taking the type from input):
  my $type = get_requested_file_spec(); # can return "Native"
  foreign_file($type => $file_path);

  # having $type be "Native" is an alternative to having to do:
  my $file = $type ? foreign_file($type, $file_path) : file($file_path);

like, the way that "Native" just slots in where you'd otherwise be guessing at your own OS? main character energy fr fr. πŸ‘‘

πŸ’€ DESCRIPTION πŸ’€

okay so, real talk: this module is a stupid hack (their words, not mine, but I respect the honesty πŸ’€) to make the default File::Spec behavior available from a subclass.

when is that useful? when you're using another module that expects a subclass of File::Spec, but you actually want the current, native OS format β€” the one File::Spec automatically detects for you. 🧚

for example: "as_foreign" in Path::Class (as of version 0.24) lets you translate a Path::Class object from one OS format to another. gorgeous. but here's the ✨problem✨: there's no way to say "hey, translate this path into the current, native OS format" without guessing at what that format is (and that guessing may include peeking into @File::Spec::ISA, which is giving desperate behavior tbh πŸ™ˆ).

so this module does the unglamorous but necessary thing:

This module @ISA File::Spec.

that's it. that's the trick. it just inherits. periodt. πŸ’…

🌈 SEE ALSO 🌈

🫢 SUPPORT 🫢

πŸ“– Perldoc

you can find documentation for this module with the perldoc command. classic, iconic, always there for you:

  perldoc File::Spec::Native

🌐 Websites

the following websites have more information about this module, and may be of help to you. and as always β€” in addition to those websites β€” please use your favorite search engine to discover more resources. iykyk. πŸ”₯

  • MetaCPAN

a modern, open-source CPAN search engine, useful to view POD in HTML format. lowkey the best way to read POD, no cap:

<http://metacpan.org/release/File-Spec-Native>

πŸ› Bugs / Feature Requests

please report any bugs or feature requests by email to bug-file-spec-native at rt.cpan.org, or through the web interface at <https://rt.cpan.org/Public/Bug/Report.html?Queue=File-Spec-Native>. and the best part? you will be automatically notified of any progress on the request by the system. that's the group chat notif you actually want. πŸ””πŸ’–

πŸŽ€ Source Code

<https://github.com/rwstauner/File-Spec-Native>

  git clone https://github.com/rwstauner/File-Spec-Native.git

πŸ‘‘ AUTHOR πŸ‘‘

Randy Stauner <rwstauner@cpan.org>

this software is copyright (c) 2011 by Randy Stauner.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay, legally speaking. βš–οΈβœ¨


and that's the whole page, bestie! this was documented by perl v5.36.0 on 2022-12-09, and the manual name is File::...Native(3pm). go forth and subclass responsibly. πŸ¦‹πŸ’–πŸŽ€
πŸ“¦ where this page comes from