Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8934005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:41:16+00:00 2026-06-15T09:41:16+00:00

For educational purposes, I’m rolling my own FAT reader (allows you to browse a

  • 0

For educational purposes, I’m rolling my own FAT reader (allows you to browse a drive, etc). My current issue is determining the current working directory (such as for the prompt in a typical command prompt). As far as I can tell, the directory table gives no info on the path you would have taken to get there. (I’ve been working off the standard I found here) Thus, my current approach is just keep track of each directory you pass through (i.e. essentially each time cd <dir> is used, put that value in a list, and remove the last one when cd .. is used)

Here’s where the issue arises. Lets say two different paths bring you to the same directory. If you then follow the .. directory upwards, the issue becomes more complicated than just removing the last directory name from your list. If .. takes you up the path you didn’t come down, you’d actually have to determine a whole new working directory.

This issue becomes irrelevant if FAT doesn’t allow undirected cycles. (I believe I read that certain file systems disallow this sort of complexity for exactly this reason of simplifying traversal, but I can’t find specific info for FAT) Do I need to worry about this? In other words, is FAT described by a tree or by a general graph?

For reference, I’m dealing with FAT16 and FAT32 (incidentally in C on Linux, but I assume that’s irrelevant)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T09:41:17+00:00Added an answer on June 15, 2026 at 9:41 am

    There’s nothing in the FATx format that disallows cycles. However, there are other issues if you allow cycles:

    • As pointed out, “..” is ambiguous when two directory entries point to the same directory. Not usually a big deal as DOS/WINDOWS maintain the full text of the directory and doing “cd ..” is a name operation, not a directory traversal. *NIX, on the other hand will have problems.
    • There are no reference counts, meaning RMDIR X cannot effectively free disk space unless it does an entire tree walk to see if there are any other references to that directory.
    • Worse, it could be possible to “disconnect” the cycle from the root, leaving unreachable space which CHKDSK/fsck would need to clean up.

    (N.B. these are some of the reasons *NIX doesn’t allow hard links to directories).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an RSS reader purely for my own educational purposes and am
I would like to create my own database server for educational purposes. My problem
I am trying to build my own simple MVC framework, mainly for educational purposes
I want to create my own template system for node.js (just for educational purposes),
Just for educational purposes, I'm working on making a letter-and-symbol recognition program in Python,
I’m working on simple class something like in memory linux-like filesystem for educational purposes.
I'm implementing my own BigNumber class in C# for educational purposes. For a start,
As almost every programmer, I'm writing my own PHP framework for educational purposes. And
For educational purposes, I need to send an email through an SMTP server, using
Any ideas where can I find a free (trial or for educational purposes) WebSphere

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.