Allocate disk spce before file copy
-
Is there a way to allocate disk space before copying a file in c#? sample code will be greate help Thanks
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
-
Is there a way to allocate disk space before copying a file in c#? sample code will be greate help Thanks
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.