Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Algorithms
  4. Representing physical directory strucure

Representing physical directory strucure

Scheduled Pinned Locked Moved Algorithms
questiondatabasedata-structurescollaborationannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    Fadi Yoosuf
    wrote on last edited by
    #1

    Hi I am planning to implement a custom version control system. Is there anyway to represent physical directory structure in database? Or should I represent them using 'tree' data structure? If using tree data structure, how can I save the contents of tree to an external file?? thanks fadi

    L 1 Reply Last reply
    0
    • F Fadi Yoosuf

      Hi I am planning to implement a custom version control system. Is there anyway to represent physical directory structure in database? Or should I represent them using 'tree' data structure? If using tree data structure, how can I save the contents of tree to an external file?? thanks fadi

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Yes, I have done this quite often there are several ways of doing this, it mostly depends on how you plan on searching the db or how you want to maintain the data. The obvious approach is to use a column file directory: c:\mydir\thisdir\nextdir\and-so-on This can make it a head ache if you need indexing. The approach I used for indexing is to use a treemap where I had two colums a and b; a is the parent and b the child. you can build a directory structure this way easily. The problem with this approach is using SQL with it. You have to load the whole tree in memory in a tree map in the application then modify it and post it back or update the 'dirty' sections after you make changes to the tree.

      "Make everything as simple as possible, but not simpler." -- Albert Einstein

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups