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
  1. Home
  2. General Programming
  3. C#
  4. Allocate disk spce before file copy

Allocate disk spce before file copy

Scheduled Pinned Locked Moved C#
csharphelpquestion
3 Posts 3 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.
  • P Offline
    P Offline
    poqeqw
    wrote on last edited by
    #1

    Is there a way to allocate disk space before copying a file in c#? sample code will be greate help Thanks

    P L 2 Replies Last reply
    0
    • P poqeqw

      Is there a way to allocate disk space before copying a file in c#? sample code will be greate help Thanks

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Are you talking about ensuring there is enough space on the disk to store the file? Obviously, if there isn't enough space, any attempt to save it will throw an exception. You would have you free up sufficient space manually.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      1 Reply Last reply
      0
      • P poqeqw

        Is there a way to allocate disk space before copying a file in c#? sample code will be greate help Thanks

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        Hi, haven't done this for a long time, but I would try and create a file, write a byte, seek to the intended file size and write another byte; then you could rewind and write the actual data, or close and overwrite any way you choose. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


        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