Sr. Content Developer at Microsoft, working remotely in PA, TechBash conference organizer, former Microsoft MVP, Husband, Dad and Geek.
166309 stories
·
33 followers

Agents, Skills, Tools, and Plugins

1 Share

Building with AI comes with a growing vocabulary. Agents, skills, plugins, tools, MCP servers. These terms often appear together, making it difficult to understand what each piece does and how they connect.

The relationship becomes clearer when you follow the work: an agent pursues a goal, a skill provides reusable instructions, and a plugin packages capabilities for installation and sharing. Tools give the agent operations it can run along the way.

Understanding these distinctions helps answer practical questions. How do you give a coding agent API expertise? How do you capture a workflow your team repeats? And how do you take the agent application you build from your laptop to a running deployment?

Let’s start with the agent.

Agents: the systems that do the work

An AI agent uses a model to work toward a goal, choosing actions and using tools along the way.

Imagine asking a coding agent:

“Investigate why this API integration is failing and fix it.”

The agent might inspect your implementation, send a request, examine the response, update the code, and run tests. Each result helps determine what it does next.

The model supplies reasoning and language capabilities. The surrounding software provides instructions, tools, context, permissions, and an environment where actions can run.

An agent’s usefulness depends on how those pieces work together. It needs relevant information, tools that behave predictably, and a way to check whether it accomplished the task.

Agents can serve different purposes. A coding agent helps develop software. A support agent answers questions using company information. An issue analysis agent retrieves GitHub discussions and identifies recurring user problems.

For each application, the design questions are concrete: What should the agent accomplish? What information can it access? Which actions can it take? How will you know whether it succeeded?

Skills: reusable instructions for completing a task

A general-purpose agent doesn’t automatically know how your team approaches a particular job.

You might have a specific process for testing APIs, investigating incidents, or writing release notes. Explaining that process in every conversation gets repetitive. A skill captures the instructions and supporting resources so the agent can reuse them.

In the Agent Skills format, a skill is a folder containing a SKILL.md file. It can also include scripts, templates, examples, and reference documents. Compatible agents discover available skills and load the relevant instructions when a task calls for them.

An API testing skill, for example, could guide an agent to:

  • Read the API contract and authentication requirements.
  • Test successful requests and expected failures.
  • Validate response bodies as well as status codes.
  • Keep credentials out of committed files.
  • Report what passed and what remains unverified.

A skill makes that process available beyond a single prompt. It gives the agent a documented approach to follow, and it gives your team something concrete to review and improve.

Skills don’t retrain the underlying model. They add instructions and resources to the agent’s working context. They also don’t automatically grant access to external systems. An agent following an API testing skill still needs a tool capable of sending requests or running tests.

Tools: the operations an agent can run

Tools provide specific actions, such as reading a file, querying a database, sending an API request, or running a test collection.

A skill might explain when and how to test an endpoint. A tool runs the request and returns the result.

Developers can expose tools through command-line programs, application functions, or MCP servers. MCP, the Model Context Protocol, provides a standard way for compatible AI applications to connect to external capabilities.

For an issue analysis agent, tools might retrieve issues, fetch comments, and look up repository information. The agent uses the returned data to decide whether it has enough information to complete its analysis.

Tool design matters because the agent depends on what those tools return. Clear inputs, useful errors, and predictable outputs make it easier to handle both successful and failed operations.

Plugins: packaging capabilities for reuse

A plugin packages extensions so they can be installed and shared.

The exact contents depend on the host application. In Claude Code, for example, a plugin can bundle skills, subagent definitions, hooks, and MCP server configurations. These components can also exist independently; a plugin distributes them as one unit.

This is useful when a team wants a consistent setup. Rather than manually assembling the same instructions and integrations, developers can install a maintained package.

A plugin could distribute several related skills, configuration for connecting to tools, and other extensions supported by the host.

Here’s how the pieces relate:

Component What it contributes Example
Agent Chooses and runs steps toward a goal Investigates a failing integration
Skill Provides reusable instructions and resources Describes how to test API error handling
Tool Runs a specific operation Sends a request or runs a collection
Plugin Packages extensions for installation Distributes API skills and integration configuration

An agent can follow a skill and call tools, while a plugin makes related capabilities easier to install and share.

How the pieces work together

Consider building an agent that analyzes GitHub issues and summarizes recurring user problems.

You could use a coding agent equipped with the Postman plugin to develop and test the application’s API integrations. You could then deploy the application on Astropods.

There are two agents in this workflow: the coding agent helping you develop the application, and the issue analysis agent you’re building for users.

The coding agent needs capabilities for software development and testing. The deployed agent needs capabilities for retrieving GitHub information and analyzing it. Keeping those roles clear helps explain where Postman and Astropods fit.

The Postman plugin: API capabilities for your coding agent

Agent applications often depend on APIs to retrieve information or take action. Getting those integrations right requires understanding authentication, pagination, response formats, rate limits, and failure behavior.

The Postman plugin brings API development capabilities into coding environments such as Claude Code, Codex, and Cursor. Its skills cover API discovery, Collections, testing, mocking, documentation, monitoring, and CI integration. It uses the Postman CLI for supported tasks and falls back to the Postman MCP Server where needed.

For the GitHub issue analysis application, you might ask your coding agent:

“Test the GitHub integration. Verify that it retrieves every page of comments and handles missing credentials and rate limits.”

The coding agent interprets your goal. Relevant skills guide its approach, and Postman’s tools provide operations it can run.

You can then review the resulting requests, tests, files, and findings to understand what changed and what was verified.

Why integration quality affects agent quality

Suppose the GitHub API returns the first page of comments successfully, but your implementation never retrieves subsequent pages.

Your agent could produce a convincing summary based on incomplete information. The request succeeded, yet the application missed part of the conversation.

That makes API behavior part of agent quality.

Useful checks for this application would include:

  • Does it retrieve all relevant pages of issues and comments?
  • Can it distinguish an empty result from a failed request?
  • What happens when credentials expire?
  • Does it handle rate limits without silently dropping information?
  • Can the final summary point back to supporting issues?

Some checks belong in API tests. Others require evaluating the agent’s output. Both help establish whether the application completes its job.

During development, for example, you could use mock responses to exercise rate limits and authentication failures. You could also test against a known set of issues to check whether the agent identifies expected themes and supports its conclusions.

Astropods: taking your agent into a running environment

Once your agent works locally, it needs an environment where users can access it.

That means configuring its runtime, model access, credentials, dependencies, and interfaces. You also need visibility into what happens after deployment.

Astropods provides a platform for building, deploying, and managing AI agents. Its lifecycle takes a project from local development to a published blueprint and then to a running deployment. An astropods.yml specification declares resources and capabilities such as models, knowledge stores, secrets, and messaging.

For the issue analysis agent, you would implement its behavior and tools, declare the resources it needs, and test it locally.

Publishing creates a versioned blueprint containing the container image and specification. Deploying turns that blueprint into a running agent. The same blueprint can support multiple deployments, allowing the packaged application to run across different environments.

Your team can then interact with the deployed application through its configured interface.

One boundary matters here: installing a plugin in your coding environment doesn’t automatically make it part of the deployed application. Your deployed agent needs its own tools, instructions, dependencies, and credentials configured for its runtime.

Deploying agents in production requires ongoing evaluation

A running deployment is a milestone. Production use also requires evidence that the agent behaves usefully under real conditions.

For the issue analysis agent, you need to understand whether it retrieves the right information, produces supported conclusions, handles failures, and completes tasks within acceptable time and cost.

Astropods supports traces covering tool calls, model token usage, and latency. Those traces help you inspect runs and investigate slow or failed interactions.

If a summary takes too long, you can investigate whether the time went into fetching comments, retrying an API request, or making multiple model calls.

You also need to evaluate the result itself. A trace can show that a tool ran successfully. Assessing the summary tells you whether the agent accurately represented the issues it retrieved.

For this application, a useful evaluation set could include:

Scenario What to evaluate
Issues with known recurring themes Whether the agent identifies the expected patterns
Comments containing conflicting feedback Whether it represents disagreement accurately
No matching issues Whether it explains that there is insufficient evidence
API failures or partial results Whether it reports the limitation clearly
Claims in the final summary Whether they link back to supporting issues

These checks give you a foundation for comparing behavior as you change instructions, tools, models, or application code.

Putting the pieces to work

Start by defining the job your agent should perform and what success looks like. Build the integrations it needs, then test both their behavior and the outputs the agent produces.

Use skills to capture procedures worth repeating. Use plugins to distribute related capabilities in supported environments. The Postman plugin brings API development and testing into your coding agent’s workflow, helping you verify the integrations your application depends on.

When the application is ready to run beyond your laptop, Astropods provides a path to package, deploy, and observe it.

Agents pursue goals. Skills guide their approach. Tools run operations. Plugins package extensions. Bringing those pieces together thoughtfully gives you a clearer path from a useful local experiment to an agent people can depend on in production.

Resources

Postman plugin

Astropods

More on Astropods and AI agents

Specs and standards

The post Agents, Skills, Tools, and Plugins appeared first on Postman Blog.

Read the whole story
alvinashcraft
6 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Tech News, XBox CLI, and Translating Blazor Applications

1 Share
From: Fritz's Tech Tips and Chatter
Duration: 1:15:23
Views: 20

There's some tech news to discuss, and I want to start translating DayFrame for other locales

Read the whole story
alvinashcraft
6 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

AI Agents for Beginners – From Architecture to a Working Sales & Lead Enrichment Agent

1 Share

An AI agent is an LLM that is given a goal, a set of tools, and the autonomy to decide which tools to use in a loop until the goal is complete. The agent built in this course researches each new sales lead on the live web, scores it against an ideal customer profile, and drafts a personalized outreach email.

We just published a course on the freeCodeCamp.org YouTube channel that will teach you how AI agents work and how to build a sales and lead enrichment agent from scratch. I created this course, and Oxylabs provided a grant to make it possible.

You'll build the workflow visually in n8n, then see the same agent loop in Python, using the Oxylabs Web API for web search and scraping.

In this course, you will learn:

  • Agent Architecture
    How the model, instructions, memory, and tools fit together in a loop of thinking, calling a tool, and observing the result.
  • Live Web Data for Agents
    Why stale training data and plain HTTP GET requests break down on JavaScript-rendered sites, bot protection, and messy HTML.
  • Building the Workflow in n8n
    How to connect a Google Sheets trigger, an AI Agent node, Oxylabs search and scrape tools, and a structured output parser.
  • The Same Agent in Python
    How a short loop runs whichever Oxylabs tool the model requests and appends each result to the conversation history.
  • Testing & Production Reliability
    How the agent handles Vercel and a local bakery, plus five tips such as capping max iterations and keeping a human in the loop.
  • MCP & Agent Skills
    How the Oxylabs remote MCP server and skill.md instruction files fit into a larger agent setup.

Watch the full course on the freeCodeCamp.org YouTube channel (43-minute watch).



Read the whole story
alvinashcraft
7 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

Make your next learning decision count with Pluralsight

1 Share

Blog Pluralsight choose next skill banner image

Last week, at VSLive! in Orlando, I spoke with dozens of Visual Studio subscribers who are working to more effectively position themselves and their learning investments in the midst of a rapidly changing industry.  

I heard one thing that particularly stood out while I was there: Prioritizing which skills to improve next can be an overwhelming challenge. There’s so much to tackle and time is limited. And let’s face it: sometimes we don’t know what we don’t know. 

Consider a developer who wants to strengthen their Azure skills. 

They could explore identity and access management, application architecture, networking, or monitoring. If they’re considering implementing secure access to Azure services, they may benefit from strengthening their knowledge of managed identities and role-based access control. A developer working to improve application availability might have more immediate reasons to focus on monitoring and resiliency over other skills.  

With all the relevant learning areas, if you could make the time to improve one technical skill over the next few months, how would you decide which skill to focus on? 

Get a clearer picture of your current skills 

Understanding your current proficiency level can help you make an informed decision about what to learn next. While you probably have a good sense of the technologies you work with regularly, a structured evaluation can introduce technical questions and scenarios that go beyond what you encounter in your everyday development work. 

That’s where Skill IQ Discovery assessments can help. For example, the Managing Microsoft Azure Identity and Security assessment offered by Pluralsight covers subjects such as multi-factor authentication, role-based access control, managed identities, and hybrid identity. Completing the assessment gives participants a way to evaluate their knowledge across these areas.  

After completing the assessment, they can review their proficiency results against those of other assessment takers, examine the answers to each question, and consider recommended learning resources based on their assessment results. 

Turn assessment results into learning priorities 

Let’s consider a developer working on an application that uses several Azure services. After completing an assessment, the developer reviews their answers and recognizes opportunities to strengthen their understanding of both hybrid identity and Azure role-based access control (RBAC). 

Hybrid identity is less familiar to them, making it a tempting place to start. But their team has been troubleshooting access problems involving role assignments across several Azure resources. 

A stronger understanding of RBAC could help the developer investigate how permissions are assigned, determine whether access is scoped appropriately, and recognize when permissions are broader than necessary. 

Although hybrid identity represents a less familiar area, strengthening their understanding of RBAC could have a more immediate impact on their work. 

Instead of treating every knowledge gap as a new learning assignment, the developer can use their assessment findings to identify a priority, explore the relevant Pluralsight learning resources, and apply what they’ve learned to the team’s current challenges.  

Put your Pluralsight benefit to work 

Eligible Visual Studio subscribers can access Skill IQ Discovery assessments, learning paths, labs and curated learning content through Pluralsight. These resources can support the different stages of your learning process. 

You might begin with a Skill IQ Discovery assessment to establish a baseline. After reviewing your results, you can browse Pluralsight’s recommended content and select courses or learning paths that align with your assessment results for targeted learning. And there are plenty of opportunities to apply new concepts through hands-on learning.  

Explore Pluralsight through your Visual Studio Subscription 

If you’re an eligible Visual Studio subscriber and haven’t explored your Pluralsight benefit, visit the Visual Studio Subscriber Benefits portal, find Pluralsight under Professional Development, and activate your benefit. Benefit duration varies by subscription level, with eligible Enterprise subscribers receiving 12 months and Professional subscribers receiving 6 months of access. 

Once you’ve signed in to Pluralsight, explore Skill IQ Discovery and consider which recommended resources could help you strengthen the capabilities that matter most to your work. 

Thanks for being part of the Visual Studio community, and happy learning! 

The post Make your next learning decision count with Pluralsight  appeared first on Visual Studio Blog.

Read the whole story
alvinashcraft
7 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

The agentic software factory: Building the floor

1 Share

Part 2 of 5: The Agentic Software Factory


In Part 1 I laid out the premise: humans own intent and design, agents own throughput, and the factory is the set of stations and checks that connects the two. That is a nice paragraph. Nice paragraphs have never once shipped software. This post is the part where we pour the concrete.

The steps below are in the order I actually do them, and the order matters. Every team I have watched try this out of order ends up with fast agents producing fast inconsistency, because they automated the line before the line existed. Automating chaos just gets you chaos with better uptime.

Step 0: Pick one repo and one kind of work

Do not start with the whole organization. I know. The slide deck says “enterprise-wide transformation.” Ignore the slide deck.

Pick one repository that matters, has a reasonable test suite, and has a team that actually wants this. Then pick one class of work to run through the factory first. Bug fixes with a reproduction are a great start. So are small, well-understood features like “add a field end to end” or “add an endpoint that follows the existing pattern.”

The goal of the first few weeks is not throughput. It is finding out where your line leaks.

Step 1: Make the repo bootable

An agent cannot verify anything it cannot run. Before anything else, the repository needs a single, documented, boring way to install, build, test, and run the application locally. If a new human hire needs a Slack thread and a senior engineer’s afternoon to get a passing test run, an agent is going to burn an hour of tokens rediscovering the same tribal knowledge, and then guess. Confidently.

I wrote a whole post on agent-ready local environments, so the short version here:

make setup     # dependencies, local services, seed data
make test      # the fast suite, under a couple of minutes
make check     # lint, types, format, the stuff CI will yell about
make run       # the app, on a port you can configure

Whatever your stack calls these, they need to exist, work from a clean checkout, and be the same commands CI runs. If they are not the same commands CI runs, the agent will pass locally and fail in CI, and you will spend your review time on the difference. Ask me how I know.

Step 2: Write down the context

This is the step people skip, and it is the one that makes the biggest difference to consistency. Agents start every session with no memory of your team. None. Whatever they need to know about how you build software has to live in files they will read.

I have been on about this for a while: AI is forcing docs to finally grow up, and the teams that treat documentation as a product are the ones whose agents behave. Turns out writing things down was a good idea all along. Who knew. (Everyone. Everyone knew.)

I keep four kinds of context:

  • An agent guide at the root. AGENTS.md, CLAUDE.md, or whatever your tooling picks up automatically. Keep it short. What the system is, how to run it, the five or six rules that get broken most, and pointers to everything else. If it is longer than a couple of screens, agents and humans both stop reading it carefully. Humans just stop sooner.
  • Conventions with reference implementations. “Use the repository pattern” is weak. “New repositories look like src/orders/OrderRepository.ts, including how errors are mapped and how tests are structured” is strong. Point at real code. Agents copy examples far more reliably than they follow prose.
  • Architecture decision records. Short documents that say what was decided, why, and what was rejected. These are what keep an agent from “helpfully” introducing a second HTTP client or a shiny new state management library. If your team does not write ADRs, start with the three decisions you have had to re-explain most often. You know the ones.
  • A domain glossary. The words your business uses, what they mean, and which ones are easy to confuse. “Account” versus “customer” versus “tenant” causes more agent mistakes than any language feature ever will.

I like keeping the cross-repo parts of this in a notes repo for shared project context and the repo-specific parts right next to the code.

Step 3: Define the unit of work

Every task that enters the factory needs the same shape. I use an issue template along these lines:

## Goal
One or two sentences. What is true when this is done?

## Acceptance criteria
- Observable behaviors, each one testable.

## Scope
- Paths, modules, or contracts this task may change.

## Out of scope
- Things that look related and must not change.

## Decisions that apply
- Links to ADRs and conventions.

## Stop condition
- When to stop and ask instead of continuing.

This is the input spec for the build station. It is also a gift to the human reviewer, who now knows exactly what they are checking the diff against instead of reverse-engineering intent from the code. Most of the time an agent can draft this from a rough request and a human tightens it. That draft-then-approve pattern is the ask, plan, confirm loop applied at intake, and a close cousin of the chat-first spec method I wrote up last year.

If a task cannot be written in this shape, it is not ready for the factory. Send it to a human for design, or split it. “Make checkout better” is a wish, not a task.

Step 4: Isolate every writer

Each implementer agent gets its own workspace: its own worktree or clone, its own branch, its own ports, and ideally its own database or schema. Shared mutable state between parallel writers is where most of the confusing failures come from. Two agents pointing tests at the same local database will each conclude the other one’s data is a bug, and then they’ll both “fix” it. Delightful.

Isolation also means scoping. The task’s “Scope” section in Step 3 is not decoration. In Part 3 we will have the harness enforce it, but even before that, it tells the reviewer what a suspicious diff looks like.

Step 5: Build the gates

Gates are the checks a change must pass to move to the next station. They need two properties: they run automatically, and they cannot be talked past. Not by the agent, not by a deadline, not by “it’s just a one-liner.”

I split them into two tiers:

  • The fast gate runs inside the build station, as often as the agent wants. Format, lint, type check, and the unit tests for touched modules. Under a couple of minutes. This is the agent’s own feedback loop, and the faster it is, the less the agent guesses.
  • The full gate runs before a change is handed to review. The whole test suite, integration and contract tests, a dependency and secret scan, a build of the deployable artifact. This is the same thing CI runs.

Then add the checks that encode design, not just correctness. These are the ones that hold consistency at scale:

  • Contract tests for every API and event other code depends on, so a “small refactor” that changes a response shape fails loudly instead of in production.
  • Architecture tests where your stack supports them, like “the domain module does not import from the web module.” Cheap to write, and they catch a whole category of agent drift.
  • Migration checks that run schema changes forward and back against a copy of realistic data. Agents have a well documented fondness for the destructive change at 2:13AM. Gate it.

A test an agent wrote and then quietly deleted is not a gate. The gates live in the repository and in CI, and changes to them get the same human approval as changes to a contract.

Step 6: Define the stations as files

This is where it starts feeling like a factory. Each station gets a definition: what it receives, what it does, what it produces, which tools it may use, and when it stops. I keep these in the repository so they are versioned and reviewed like code, because they are code. Just written in English.

.factory/
  stations/
    intake.md        # turn a request into a scoped task
    planner.md       # turn a task into an approved plan
    implementer.md   # build one slice in an isolated workspace
    reviewer.md      # read a diff against plan + conventions
  gates/
    fast.sh
    full.sh
  register.md        # who is working on what, right now
AGENTS.md
docs/adr/
docs/conventions/

A station definition is short. Here is roughly what my reviewer looks like:

# Reviewer station

Input: a branch, the task issue, the approved plan.
Read: AGENTS.md, the ADRs linked in the plan, docs/conventions/.

Do:
- Compare the diff to the plan. Flag anything outside Scope.
- Check new code against the reference implementations.
- Check tests cover each acceptance criterion.
- Report findings with file and line, severity, and the rule broken.

Do not:
- Edit code. A fix is a new implementer task.
- Approve. A human integrates.

Output: a review report on the pull request.

Notice the reviewer does not fix things. Keeping the writer and the checker separate is the whole point of a second station. If the reviewer fixes things, you have one agent with extra steps and a fancier name.

Step 7: Give each station the least it needs

The planner needs to read the code and the docs. It does not need to write files or run migrations. The reviewer needs to read a diff and maybe run the tests. The implementer needs to write inside its workspace and run the gates. Nobody in the line needs production credentials. Nobody. Not even “just for this one debugging session.”

Write these permissions down per station. Right now they are policy. In Part 3 the harness turns them into enforcement, which is a much stronger guarantee than “the prompt said not to.”

Step 8: Keep a register

The last piece is a visible list of what is in flight: task, station, owner, workspace, the paths and contracts it owns, state, and the next decision. I described this in the post on keeping long-running agents on track. A markdown table in the repository works to start. A label scheme on your issue tracker works too. The point is that anyone, human or agent, can answer “is somebody already changing the orders contract?” before starting, not after the merge conflict.

Step 9: Run it by hand for a week

Here is the step that feels slow and saves the most time. Before automating anything, run the line manually. A human picks a task, starts a planner session with the station definition, approves the plan, starts an implementer, runs the gates, starts a reviewer, and integrates. Like an animal.

You will find out fast where it leaks. The conventions doc is missing the thing every agent gets wrong. The fast gate takes eleven minutes. The issue template has no place for “this endpoint is called by the mobile app, which we cannot redeploy for two weeks.” Fix the line each time. That is the Learn station doing its job before the factory even has a conveyor belt.

Where we are

At this point you have a factory floor: a bootable repo, written context, a standard unit of work, isolated workspaces, gates that cannot be skipped, station definitions, permissions on paper, and a register. Agents can run in it. Humans are still turning every crank.

Tomorrow in Part 3 we add the piece that turns stations on paper into stations that actually behave: the agentic harness. Then on Monday, in Part 4, we make the whole thing start up on its own.

Read the whole story
alvinashcraft
7 minutes ago
reply
Pennsylvania, USA
Share this story
Delete

What does Windows “posix-style delete” mean, and how do I get it?

2 Shares

Windows added a new way of deleting files, known as “posix-style delete”. You do it by opening the file with DELETE access and then calling Set­File­Information­By­Handle with File­Disposition­Info­Ex and a FILE_DISPOSITION_INFO_EX structure that specifies FILE_DISPOSITION_FLAG_POSIX_SEMANTICS in addition to FILE_DISPOSITION_FLAG_DELETE.

#include <wil/result_macros.h>
#include <wil/resource.h>

HRESULT DeleteWithPosixSemantics(PCWSTR path)
{
    wil::unique_file h(CreateFileW(path,
        DELETE, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
        nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr));
    RETURN_LAST_ERROR_IF(!h);
    FILE_DISPOSITION_INFO_EX info{};
    info.Flags = FILE_DISPOSITION_FLAG_DELETE | FILE_DISPOSITION_FLAG_POSIX_SEMANTICS;
    RETURN_IF_WIN32_BOOL_FALSE(SetFileInformationByHandle(h.get(), FileDispositionInfoEx,
        &info, sizeof(info)));
    return S_OK;
}

Okay, that’s great, but what does Posix semantics mean?

Deleting a file consists of multiple steps. The most visible part is removing the directory entry. The less visible part is freeing up the disk space. And the invisible part is the various other internal bookkeeping that has to happen.

In a normal deletion, all three of the those steps happen when the last open handle is closed. This results in the situation where a file has been deleted, but there are still open handles to it, so the file remains visible in the directory even after you deleted it.

A file in this “I’ve already been deleted but am waiting for the last handle to be closed so I can start doing the deletion stuff” state will return STATUS_DELETE_PENDING if you try to open it. “Don’t open me. I’m a dead file walking.”

Deletion with Posix semantics separates out one of the steps: Removing the directory entry.

When you specify Posix semantics on deletion, closing the handle on which the deletion was issued causes the directory entry to be removed immediately. The rest of the work is then deferred until the last open handle to the file is closed.

What this means in the case where there is still an open handle to the file is that the directory entry disappears immediately, but the disk space is not scheduled for reclamation until the last handle is closed.

Note that I wrote “scheduled for reclamation”. When the last handle is closed, the system doesn’t reclaim the disk space as part of the handle-close operation. Rather, it puts “reclaim the disk space and clean up the metadata” on a work queue that it processes in the background.

This means that if you delete a file with Posix semantics, then the disk space will definitely not be reclaimed until the last handle is closed, and even after you close it, it may take a little while longer. How much longer depends on how busy the system is.

This delayed reclamation is an annoyance if the purpose of deleting the file was to free up disk space.

Deletion with Posix semantics does not change any of the other rules about file deletion, such as requiring DELETE access, and that all other open handles be opened with FILE_SHARE_DELETE sharing mode. All it affects is when the work of deletion happens.

  Normal delete Delete with
Posix semantics
Requires DELETE access Yes Yes
Requires all other handles
to be FILE_SHARE_DELETE
Yes Yes
Filename disappears when… All handles are closed Deleting handle is closed
Disk space reclaimed… When all handles are closed After all handles are closed

Bonus chatter: If you try to unmount a volume before the system can work through all of the deferred deletions, the unmount still occurs immediately, because we don’t want to slow down volume unmount. The deferred deletions will resume processing when the volume is remounted.

Bonus bonus chatter: If you ask for the final path name for a handle to a file that has been posix-style deleted, it returns you something like \\?\C:\$Extend\$Deleted\005200000007D9D9412284ED. This probably gives you a clue as to how posix-style delete works: The file is moved to a secret directory with a unique name. So the file still has a name; it’s just not the same that it was opened with.

The post What does Windows “posix-style delete” mean, and how do I get it? appeared first on The Old New Thing.

Read the whole story
alvinashcraft
7 minutes ago
reply
Pennsylvania, USA
Share this story
Delete
Next Page of Stories