• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Tuesday, May 20, 2025
Techcratic
Click For A Secret Deal
  • TC
  • AI
    Artificial Intelligence

    Set up a custom plugin on Amazon Q Business and authenticate with Amazon Cognito to interact with backend systems

    Artificial Intelligence

    StreamBridge: Turning Your Offline Video Large Language Model into a Proactive Streaming Assistant

    Artificial Intelligence

    3 Excellent Practical Generative AI Courses

    Artificial Intelligence

    Building End-to-End Data Pipelines with Dask

    Artificial Intelligence

    Automate document translation and standardization with Amazon Bedrock and Amazon Translate

    Artificial Intelligence

    InterVision accelerates AI development using AWS LLM League and Amazon SageMaker AI

    Artificial Intelligence

    FireDucks: An Accelerated Fully Compatible Pandas Library

    Artificial Intelligence

    Breaking Out of Beginner: Python Patterns for Intermediate Data Scientists

    Artificial Intelligence

    Building a Personal Knowledge Management Tool with Reor

  • Crypto
    Milei Dissolves Argentine Task Force Investigating Alleged Libra Market Manipulation

    Milei Dissolves Argentine Task Force Investigating Alleged Libra Market Manipulation

    SEC Chair Voted Against Suing Elon Musk: Reuters

    Elizabeth Warren Slams GENIUS Act, Warns Trump Crypto Crash

    Blackrock, Fidelity, Ark 21shares Fuel $667 Million Surge in Bitcoin ETFs

    Blackrock, Fidelity, Ark 21shares Fuel $667 Million Surge in Bitcoin ETFs

    Crypto.com and Canary Capital Launch Canary CRO Trust for US Investors

    Crypto.com and Canary Capital Launch Canary CRO Trust for US Investors

    Jack Dorsey Fights Against Sats, Supports Controversial Changes for Bitcoin

    Jack Dorsey Fights Against Sats, Supports Controversial Changes for Bitcoin

    Fibonacci Retracement: A Trader’s Compass in the Bitcoin Market

    Fibonacci Retracement: A Trader’s Compass in the Bitcoin Market

    Moscow Releases Tax Calculator for Russian Crypto Miners

    South Korean Experts Warn Seoul of Mounting ‘Stablecoin Danger’

    JPMorgan Will Allow Clients to Buy Bitcoin, CEO Jamie Dimon Confirms

    JPMorgan Will Allow Clients to Buy Bitcoin, CEO Jamie Dimon Confirms

    Bitcoin fractal analysis forecasts new all-time highs above $110K by end of week

    Bitcoin fractal analysis forecasts new all-time highs above $110K by end of week

  • Cybersecurity
    Cybersecurity

    AWS Default IAM Roles Found to Enable Lateral Movement and Cross-Service Exploitation

    Cybersecurity

    South Asian Ministries Hit by SideWinder APT Using Old Office Flaws and Custom Malware

    Cybersecurity

    Chinese Hackers Deploy MarsSnake Backdoor in Multi-Year Attack on Saudi Organization

    Cybersecurity

    Go-Based Malware Deploys XMRig Miner on Linux Hosts via Redis Configuration Abuse

    Cybersecurity

    RVTools Official Site Hacked to Deliver Bumblebee Malware via Trojanized Installer

    Cybersecurity

    Ransomware Gangs Use Skitnet Malware for Stealthy Data Theft and Remote Access

    Cybersecurity

    Firefox Patches 2 Zero-Days Exploited at Pwn2Own Berlin with $100K in Rewards

    Cybersecurity

    New HTTPBot Botnet Launches 200+ Precision DDoS Attacks on Gaming and Tech Sectors

    Cybersecurity

    Top 10 Best Practices for Effective Data Protection

  • Deals
    Office Chair Ergonomic Desk Chair, 330 LBS Home Mesh Office Desk Chairs with Wheels,…

    Office Chair Ergonomic Desk Chair, 330 LBS Home Mesh Office Desk Chairs with Wheels,…

    Intehill 240Hz Portable Monitor, A+ Grade Fast IPS LCD 15.6 Portable Gaming Monitor, AMD…

    Intehill 240Hz Portable Monitor, A+ Grade Fast IPS LCD 15.6 Portable Gaming Monitor, AMD…

    SteelSeries QcK Gaming Mouse Pad – Large Cloth – Optimized For Gaming Sensors

    SteelSeries QcK Gaming Mouse Pad – Large Cloth – Optimized For Gaming Sensors

    Logitech G29 Driving Force Racing Wheel and Floor Pedals, Real Force Feedback, Stainless…

    Logitech G29 Driving Force Racing Wheel and Floor Pedals, Real Force Feedback, Stainless…

    My Universe – School Teacher (Nintendo Switch)

    My Universe – School Teacher (Nintendo Switch)

    KontrolFreek FPS Freek Galaxy Black for PlayStation 4 (PS4) and PlayStation 5 (PS5) |…

    KontrolFreek FPS Freek Galaxy Black for PlayStation 4 (PS4) and PlayStation 5 (PS5) |…

    WWE Smackdown vs Raw 2009 – Playstation 3 (Renewed)

    WWE Smackdown vs Raw 2009 – Playstation 3 (Renewed)

    Super Mario Hover Shell Strike – Tabletop or Floor Multiplayer Sports Game for Ages 4+

    Super Mario Hover Shell Strike – Tabletop or Floor Multiplayer Sports Game for Ages 4+

    Seagate 3TB 7200RPM 64MB Cache SATA 6.0Gb/s 3.5in (Heavy Duty) Internal Desktop Hard…

    Seagate 3TB 7200RPM 64MB Cache SATA 6.0Gb/s 3.5in (Heavy Duty) Internal Desktop Hard…

  • Gaming
    Zelda OoT Playthrough:001

    Zelda OoT Playthrough:001

    Fooled by a false story about Steam account hacks? Have I Been Pwned 2.0 will now shower you with confetti when you have not, in fact, been pwned

    Fooled by a false story about Steam account hacks? Have I Been Pwned 2.0 will now shower you with confetti when you have not, in fact, been pwned

    Minish Cap 100% Walkthrough – Part 52/61 – Dark Hyrule Castle Map

    Minish Cap 100% Walkthrough – Part 52/61 – Dark Hyrule Castle Map

    Ralis Channel Crystals – Tears Of the Kingdom

    Ralis Channel Crystals – Tears Of the Kingdom

    The Legend of Zelda: Breath of the Wild – Dagah Keek Shrine Walkthrough [HD 1080P]

    The Legend of Zelda: Breath of the Wild – Dagah Keek Shrine Walkthrough [HD 1080P]

    AI Blueprint for Video Search and Summarization Now Available to Deploy Video Analytics AI Agents Across Industries

    AI Blueprint for Video Search and Summarization Now Available to Deploy Video Analytics AI Agents Across Industries

    Zelda Ocarina of Time 3D 100% Walkthrough – Part 68/78 – Spirit Temple Part 3 (Commentary)

    Zelda Ocarina of Time 3D 100% Walkthrough – Part 68/78 – Spirit Temple Part 3 (Commentary)

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 22)

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 22)

    Semiconductor Industry Accelerates Design Manufacturing With NVIDIA Blackwell and CUDA-X

    Semiconductor Industry Accelerates Design Manufacturing With NVIDIA Blackwell and CUDA-X

  • Tesla
    25FT Tesla Extension Charger,B0DG4WMBSQ, with NACS Plug,Support 50A 240V Tesla Charger…

    25FT Tesla Extension Charger,B0DG4WMBSQ, with NACS Plug,Support 50A 240V Tesla Charger…

    Center Console Wireless Charging Silicone Mat Compatible with Tesla Model 3 Highland…

    Center Console Wireless Charging Silicone Mat Compatible with Tesla Model 3 Highland…

    Tesla Model 3 Trunk Grocery Bag Hook – Trunk Grocery Bag Holder for 2018-2023, Interior…

    Tesla Model 3 Trunk Grocery Bag Hook – Trunk Grocery Bag Holder for 2018-2023, Interior…

    Universal Car Soft Roof Rack Pads Luggage Carrier for Kayak Surfboard Canoe Heavy Duty…

    Universal Car Soft Roof Rack Pads Luggage Carrier for Kayak Surfboard Canoe Heavy Duty…

    KUST Floor Mats & Bed Mat for Tesla Cybertruck 2023-2025, Custom Fit All Weather Floor…

    KUST Floor Mats & Bed Mat for Tesla Cybertruck 2023-2025, Custom Fit All Weather Floor…

    Tesla paid Powerwall owners $10 million through virtual power plants

    Tesla paid Powerwall owners $10 million through virtual power plants

    4PCS Wheel Center Hub Caps Cover for Tesla Cybertruck, ABS Full Coverage Wheel Hub…

    4PCS Wheel Center Hub Caps Cover for Tesla Cybertruck, ABS Full Coverage Wheel Hub…

    NACS to CCS1 Charging Adapter, Max 250KW Supercharger Adapter, Electric Vehicle Charging…

    NACS to CCS1 Charging Adapter, Max 250KW Supercharger Adapter, Electric Vehicle Charging…

    2 Pack HEPA Air Filter for Tesla Model 3 Model Y, Compatible with 2016-2024, 2 Count,…

    2 Pack HEPA Air Filter for Tesla Model 3 Model Y, Compatible with 2016-2024, 2 Count,…

  • UFO
    Ancient Aliens: Unbelievable Extraterrestrial Encounters in Antarctica

    Ancient Aliens: Unbelievable Extraterrestrial Encounters in Antarctica

    Caddis Men’s Green Neoprene Stocking Foot Wader

    Caddis Men’s Green Neoprene Stocking Foot Wader

    The Outer Realm – Ryan Stacey – UFO/UAP Research -Contactee Support

    The Outer Realm – Ryan Stacey – UFO/UAP Research -Contactee Support

    Intergalactic: The Heretic Prophet NEW UPDATE (Naughty Dog)

    Intergalactic: The Heretic Prophet NEW UPDATE (Naughty Dog)

    Spacecraft Thermal Control Handbook, Volume I: Fundamental Technologies

    Spacecraft Thermal Control Handbook, Volume I: Fundamental Technologies

    Sesame Street: Explore Space with Elmo & Friends! | 1 HOUR Songs Compilation

    Sesame Street: Explore Space with Elmo & Friends! | 1 HOUR Songs Compilation

    yofit Da Vinci Code Mini Cryptex Lock Puzzle Box with Hidden Compartments for Notes Paper Money Rings Jewelry, Anniversary Romantic Birthday Gifts for Her Men Women Girlfriend

    yofit Da Vinci Code Mini Cryptex Lock Puzzle Box with Hidden Compartments for Notes Paper Money Rings Jewelry, Anniversary Romantic Birthday Gifts for Her Men Women Girlfriend

    Ghost attack | The Real One #horrorshorts

    Ghost attack | The Real One #horrorshorts

    TikTok Conspiracy Theories Are WILD

    TikTok Conspiracy Theories Are WILD

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    Set up a custom plugin on Amazon Q Business and authenticate with Amazon Cognito to interact with backend systems

    Artificial Intelligence

    StreamBridge: Turning Your Offline Video Large Language Model into a Proactive Streaming Assistant

    Artificial Intelligence

    3 Excellent Practical Generative AI Courses

    Artificial Intelligence

    Building End-to-End Data Pipelines with Dask

    Artificial Intelligence

    Automate document translation and standardization with Amazon Bedrock and Amazon Translate

    Artificial Intelligence

    InterVision accelerates AI development using AWS LLM League and Amazon SageMaker AI

    Artificial Intelligence

    FireDucks: An Accelerated Fully Compatible Pandas Library

    Artificial Intelligence

    Breaking Out of Beginner: Python Patterns for Intermediate Data Scientists

    Artificial Intelligence

    Building a Personal Knowledge Management Tool with Reor

  • Crypto
    Milei Dissolves Argentine Task Force Investigating Alleged Libra Market Manipulation

    Milei Dissolves Argentine Task Force Investigating Alleged Libra Market Manipulation

    SEC Chair Voted Against Suing Elon Musk: Reuters

    Elizabeth Warren Slams GENIUS Act, Warns Trump Crypto Crash

    Blackrock, Fidelity, Ark 21shares Fuel $667 Million Surge in Bitcoin ETFs

    Blackrock, Fidelity, Ark 21shares Fuel $667 Million Surge in Bitcoin ETFs

    Crypto.com and Canary Capital Launch Canary CRO Trust for US Investors

    Crypto.com and Canary Capital Launch Canary CRO Trust for US Investors

    Jack Dorsey Fights Against Sats, Supports Controversial Changes for Bitcoin

    Jack Dorsey Fights Against Sats, Supports Controversial Changes for Bitcoin

    Fibonacci Retracement: A Trader’s Compass in the Bitcoin Market

    Fibonacci Retracement: A Trader’s Compass in the Bitcoin Market

    Moscow Releases Tax Calculator for Russian Crypto Miners

    South Korean Experts Warn Seoul of Mounting ‘Stablecoin Danger’

    JPMorgan Will Allow Clients to Buy Bitcoin, CEO Jamie Dimon Confirms

    JPMorgan Will Allow Clients to Buy Bitcoin, CEO Jamie Dimon Confirms

    Bitcoin fractal analysis forecasts new all-time highs above $110K by end of week

    Bitcoin fractal analysis forecasts new all-time highs above $110K by end of week

  • Cybersecurity
    Cybersecurity

    AWS Default IAM Roles Found to Enable Lateral Movement and Cross-Service Exploitation

    Cybersecurity

    South Asian Ministries Hit by SideWinder APT Using Old Office Flaws and Custom Malware

    Cybersecurity

    Chinese Hackers Deploy MarsSnake Backdoor in Multi-Year Attack on Saudi Organization

    Cybersecurity

    Go-Based Malware Deploys XMRig Miner on Linux Hosts via Redis Configuration Abuse

    Cybersecurity

    RVTools Official Site Hacked to Deliver Bumblebee Malware via Trojanized Installer

    Cybersecurity

    Ransomware Gangs Use Skitnet Malware for Stealthy Data Theft and Remote Access

    Cybersecurity

    Firefox Patches 2 Zero-Days Exploited at Pwn2Own Berlin with $100K in Rewards

    Cybersecurity

    New HTTPBot Botnet Launches 200+ Precision DDoS Attacks on Gaming and Tech Sectors

    Cybersecurity

    Top 10 Best Practices for Effective Data Protection

  • Deals
    Office Chair Ergonomic Desk Chair, 330 LBS Home Mesh Office Desk Chairs with Wheels,…

    Office Chair Ergonomic Desk Chair, 330 LBS Home Mesh Office Desk Chairs with Wheels,…

    Intehill 240Hz Portable Monitor, A+ Grade Fast IPS LCD 15.6 Portable Gaming Monitor, AMD…

    Intehill 240Hz Portable Monitor, A+ Grade Fast IPS LCD 15.6 Portable Gaming Monitor, AMD…

    SteelSeries QcK Gaming Mouse Pad – Large Cloth – Optimized For Gaming Sensors

    SteelSeries QcK Gaming Mouse Pad – Large Cloth – Optimized For Gaming Sensors

    Logitech G29 Driving Force Racing Wheel and Floor Pedals, Real Force Feedback, Stainless…

    Logitech G29 Driving Force Racing Wheel and Floor Pedals, Real Force Feedback, Stainless…

    My Universe – School Teacher (Nintendo Switch)

    My Universe – School Teacher (Nintendo Switch)

    KontrolFreek FPS Freek Galaxy Black for PlayStation 4 (PS4) and PlayStation 5 (PS5) |…

    KontrolFreek FPS Freek Galaxy Black for PlayStation 4 (PS4) and PlayStation 5 (PS5) |…

    WWE Smackdown vs Raw 2009 – Playstation 3 (Renewed)

    WWE Smackdown vs Raw 2009 – Playstation 3 (Renewed)

    Super Mario Hover Shell Strike – Tabletop or Floor Multiplayer Sports Game for Ages 4+

    Super Mario Hover Shell Strike – Tabletop or Floor Multiplayer Sports Game for Ages 4+

    Seagate 3TB 7200RPM 64MB Cache SATA 6.0Gb/s 3.5in (Heavy Duty) Internal Desktop Hard…

    Seagate 3TB 7200RPM 64MB Cache SATA 6.0Gb/s 3.5in (Heavy Duty) Internal Desktop Hard…

  • Gaming
    Zelda OoT Playthrough:001

    Zelda OoT Playthrough:001

    Fooled by a false story about Steam account hacks? Have I Been Pwned 2.0 will now shower you with confetti when you have not, in fact, been pwned

    Fooled by a false story about Steam account hacks? Have I Been Pwned 2.0 will now shower you with confetti when you have not, in fact, been pwned

    Minish Cap 100% Walkthrough – Part 52/61 – Dark Hyrule Castle Map

    Minish Cap 100% Walkthrough – Part 52/61 – Dark Hyrule Castle Map

    Ralis Channel Crystals – Tears Of the Kingdom

    Ralis Channel Crystals – Tears Of the Kingdom

    The Legend of Zelda: Breath of the Wild – Dagah Keek Shrine Walkthrough [HD 1080P]

    The Legend of Zelda: Breath of the Wild – Dagah Keek Shrine Walkthrough [HD 1080P]

    AI Blueprint for Video Search and Summarization Now Available to Deploy Video Analytics AI Agents Across Industries

    AI Blueprint for Video Search and Summarization Now Available to Deploy Video Analytics AI Agents Across Industries

    Zelda Ocarina of Time 3D 100% Walkthrough – Part 68/78 – Spirit Temple Part 3 (Commentary)

    Zelda Ocarina of Time 3D 100% Walkthrough – Part 68/78 – Spirit Temple Part 3 (Commentary)

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 22)

    The Legend of Zelda: Ocarina of Time Master Quest Walkthrough (Pt. 22)

    Semiconductor Industry Accelerates Design Manufacturing With NVIDIA Blackwell and CUDA-X

    Semiconductor Industry Accelerates Design Manufacturing With NVIDIA Blackwell and CUDA-X

  • Tesla
    25FT Tesla Extension Charger,B0DG4WMBSQ, with NACS Plug,Support 50A 240V Tesla Charger…

    25FT Tesla Extension Charger,B0DG4WMBSQ, with NACS Plug,Support 50A 240V Tesla Charger…

    Center Console Wireless Charging Silicone Mat Compatible with Tesla Model 3 Highland…

    Center Console Wireless Charging Silicone Mat Compatible with Tesla Model 3 Highland…

    Tesla Model 3 Trunk Grocery Bag Hook – Trunk Grocery Bag Holder for 2018-2023, Interior…

    Tesla Model 3 Trunk Grocery Bag Hook – Trunk Grocery Bag Holder for 2018-2023, Interior…

    Universal Car Soft Roof Rack Pads Luggage Carrier for Kayak Surfboard Canoe Heavy Duty…

    Universal Car Soft Roof Rack Pads Luggage Carrier for Kayak Surfboard Canoe Heavy Duty…

    KUST Floor Mats & Bed Mat for Tesla Cybertruck 2023-2025, Custom Fit All Weather Floor…

    KUST Floor Mats & Bed Mat for Tesla Cybertruck 2023-2025, Custom Fit All Weather Floor…

    Tesla paid Powerwall owners $10 million through virtual power plants

    Tesla paid Powerwall owners $10 million through virtual power plants

    4PCS Wheel Center Hub Caps Cover for Tesla Cybertruck, ABS Full Coverage Wheel Hub…

    4PCS Wheel Center Hub Caps Cover for Tesla Cybertruck, ABS Full Coverage Wheel Hub…

    NACS to CCS1 Charging Adapter, Max 250KW Supercharger Adapter, Electric Vehicle Charging…

    NACS to CCS1 Charging Adapter, Max 250KW Supercharger Adapter, Electric Vehicle Charging…

    2 Pack HEPA Air Filter for Tesla Model 3 Model Y, Compatible with 2016-2024, 2 Count,…

    2 Pack HEPA Air Filter for Tesla Model 3 Model Y, Compatible with 2016-2024, 2 Count,…

  • UFO
    Ancient Aliens: Unbelievable Extraterrestrial Encounters in Antarctica

    Ancient Aliens: Unbelievable Extraterrestrial Encounters in Antarctica

    Caddis Men’s Green Neoprene Stocking Foot Wader

    Caddis Men’s Green Neoprene Stocking Foot Wader

    The Outer Realm – Ryan Stacey – UFO/UAP Research -Contactee Support

    The Outer Realm – Ryan Stacey – UFO/UAP Research -Contactee Support

    Intergalactic: The Heretic Prophet NEW UPDATE (Naughty Dog)

    Intergalactic: The Heretic Prophet NEW UPDATE (Naughty Dog)

    Spacecraft Thermal Control Handbook, Volume I: Fundamental Technologies

    Spacecraft Thermal Control Handbook, Volume I: Fundamental Technologies

    Sesame Street: Explore Space with Elmo & Friends! | 1 HOUR Songs Compilation

    Sesame Street: Explore Space with Elmo & Friends! | 1 HOUR Songs Compilation

    yofit Da Vinci Code Mini Cryptex Lock Puzzle Box with Hidden Compartments for Notes Paper Money Rings Jewelry, Anniversary Romantic Birthday Gifts for Her Men Women Girlfriend

    yofit Da Vinci Code Mini Cryptex Lock Puzzle Box with Hidden Compartments for Notes Paper Money Rings Jewelry, Anniversary Romantic Birthday Gifts for Her Men Women Girlfriend

    Ghost attack | The Real One #horrorshorts

    Ghost attack | The Real One #horrorshorts

    TikTok Conspiracy Theories Are WILD

    TikTok Conspiracy Theories Are WILD

No Result
View All Result
Techcratic
No Result
View All Result

PATH should be a system call

Hacker News by Hacker News
April 24, 2025
in Hacker News
Reading Time: 7 mins read
122 8
A A
0
Home Hacker News
Share on FacebookShare on XShare on LinkedIn

2025-04-24 19:43:00
simonsafar.com

2025/04/22

(… but… it’s a variable… how do you even)

Let us present the problem.

... a bunch of path lookups done by Emacs

This is Emacs starting up and loading some Lisp files. For which we first need to figure out where to find them.

As it happens, they could be found at many possible locations. There is a list of these locations in the load-path variable; our method is to check whether it’s present at each of them. (Also, maybe some of them come gzipped; let’s check for those ones, too.)

On my not especially overcomplicated Emacs install, the list has 59 elements.

At first sight this sounds like such a niche problem. Not only is it about Emacs but it’s also Windows; the latter is somewhat known of its less than excellent performance when it comes to small files.

As it happens though, bash on Linux does the exact same thing. We have a list of directories on PATH, and, whenever we want to launch a program, we’ll go and check each and one of them for the files we are looking for. We’re fairly lucky though: the list is pretty short.

~ $ strace bash -c asdklfjasldfjaskldfasdljf
(...)
newfstatat(AT_FDCWD, ".", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/simon/bin/asdklfjasldfjaskldfasdljf", 0x7ffe5ff8d3c0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/asdklfjasldfjaskldfasdljf", 0x7ffe5ff8d3c0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/bin/asdklfjasldfjaskldfasdljf", 0x7ffe5ff8d3c0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/bin/asdklfjasldfjaskldfasdljf", 0x7ffe5ff8d3c0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/games/asdklfjasldfjaskldfasdljf", 0x7ffe5ff8d3c0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/games/asdklfjasldfjaskldfasdljf", 0x7ffe5ff8d3c0, 0) = -1 ENOENT (No such file or directory)
          

… except wait, now we’re looking for ourselves?

newfstatat(AT_FDCWD, ".", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/simon/bin/bash", 0x7ffe5ff8d490, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/local/bin/bash", 0x7ffe5ff8d490, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/usr/bin/bash", 0x7ffe5ff8d490, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/bin/bash", {st_mode=S_IFREG|0755, st_size=1265648, ...}, 0) = 0
newfstatat(AT_FDCWD, "/bin/bash", {st_mode=S_IFREG|0755, st_size=1265648, ...}, 0) = 0

… and also… let’s not forget about our localized messages.

openat(AT_FDCWD, "/usr/share/locale/en_US.UTF-8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US.utf8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en_US/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.UTF-8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en.utf8/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/share/locale/en/LC_MESSAGES/bash.mo", O_RDONLY) = -1 ENOENT (No such file or directory)
newfstatat(2, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x1), ...}, AT_EMPTY_PATH) = 0


          

As it happens, Python is slightly smarter than either of the two above. Instead of trying various file names, it will just go and lists directories right away; it is probably this & some caching mechanisms that allow it to find some modules pretty quickly. (We’re still looking for __init__.py and similar ones one by one though.)


simon@anarillis ~/tmp> strace -f python3 -m our_test_dir.our_test_moduleb 2>&1 |grep our_test
execve("/usr/bin/python3", ["python3", "-m", "our_test_dir.our_test_moduleb"], 0x7ffc087c2c38 /* 17 vars */) = 0
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir/__init__.cpython-311-x86_64-linux-gnu.so", 0x7ffc3025b8e0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir/__init__.abi3.so", 0x7ffc3025b8e0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir/__init__.so", 0x7ffc3025b8e0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir/__init__.py", 0x7ffc3025b8e0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir/__init__.pyc", 0x7ffc3025b8e0, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0
newfstatat(AT_FDCWD, "/home/simon/tmp/our_test_dir", {st_mode=S_IFDIR|0755, st_size=4096, ...}, 0) = 0

# here is the dir listing!
openat(AT_FDCWD, "/home/simon/tmp/our_test_dir", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
write(2, "/usr/bin/python3: No module name"..., 64/usr/bin/python3: No module named our_test_dir.our_test_moduleb
          

Nevertheless, it seems that “trying to find files with a set of possible names in a set of possible directories” is a fairly common operation that not everyone has optimized yet.

(Also, is “optimizing” this really a good goal? Or does it just stand for “OK workarounds for missing file system APIs”?)

How about… instead of asking the operating system for a combination of n files at m different places, we could just give it the list of possible files and the list of possible places?

This would already cut down on the number of system calls, and, if this is going over a network, the required roundtrips.

AS/400 libraries are, by the way, solving a very similar problem. While I’m not sure what implementation they’re using underneath, they have at least a good chance for not having to try every combo all the time, given their database “filesystem”.

But then, in the end, we are just trying to perform a query, to select all the source files ever WHERE they have one of the given names & then we pick the ones that are in source directories we prefer the most (e.g. come first on the PATH list). That’s it.

As it happens, Postgres can solve this problem extremely well and quickly. (… there might be a blog post on how, at some point.)

Could it be something that the operating system or the file system just… does for you, quickly and efficiently?



Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Help Power Techcratic’s Future – Scan To Support

If Techcratic’s content and insights have helped you, consider giving back by supporting the platform with crypto. Every contribution makes a difference, whether it’s for high-quality content, server maintenance, or future updates. Techcratic is constantly evolving, and your support helps drive that progress.

As a solo operator who wears all the hats, creating content, managing the tech, and running the site, your support allows me to stay focused on delivering valuable resources. Your support keeps everything running smoothly and enables me to continue creating the content you love. I’m deeply grateful for your support, it truly means the world to me! Thank you!

BITCOIN

Bitcoin Logo

Bitcoin QR Code

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Scan the QR code with your crypto wallet app

DOGECOIN

Dogecoin Logo

Dogecoin QR Code

D64GwvvYQxFXYyan3oQCrmWfidf6T3JpBA

Scan the QR code with your crypto wallet app

ETHEREUM

Ethereum Logo

Ethereum QR Code

0xe9BC980DF3d985730dA827996B43E4A62CCBAA7a

Scan the QR code with your crypto wallet app

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Share162Tweet101Share28
Previous Post

Towerborne’s Class Mastery Update Deepens a Distinctive Looter Brawler Experience

Next Post

Keep your graphics driver fresh and your games will thank you

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

OKUA1/juvio: UV kernel for Jupyter
Hacker News

OKUA1/juvio: UV kernel for Jupyter

May 20, 2025
1.3k
Your Friendly Neighborhood Window Manager
Hacker News

Your Friendly Neighborhood Window Manager

May 20, 2025
1.3k
Systemic Gender and Positional Biases in Candidate Selection
Hacker News

Systemic Gender and Positional Biases in Candidate Selection

May 20, 2025
1.3k
A simple search engine from scratch*
Hacker News

A simple search engine from scratch*

May 20, 2025
1.3k
is-even-ai – npm
Hacker News

is-even-ai – npm

May 19, 2025
1.3k
DDoSecrets publishes 410 GB of heap dumps, hacked from TeleMessage’s archive server
Hacker News

DDoSecrets publishes 410 GB of heap dumps, hacked from TeleMessage’s archive server

May 19, 2025
1.3k
Load More
Next Post
Keep your graphics driver fresh and your games will thank you

Keep your graphics driver fresh and your games will thank you

My Daughter Faces Her Fear Of Heights! **Emotional**

My Daughter Faces Her Fear Of Heights! **Emotional**

ODDWORLD STRANGER'S WRATH Gameplay Walkthrough Part 12

ODDWORLD STRANGER'S WRATH Gameplay Walkthrough Part 12

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • AnandTech
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Weird Stuff
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • Home
  • Apple
  • Gaming
  • Microsoft
  • AnandTech