Subject: | Re: BDE_Error-If_Free_Disk_Space_Exceeds_4GB - MORE
| Date: | 19 Dec 2020 16:25:34 -0400
| From: | "Kevin Zawicki" <numberjack@wi.rr.com>
| Newsgroups: | pnews.paradox-discussions
|
I see.
But on my previous PCs and systems the 4GB fix worked.
I can't seem to get that installed on a win 10 machine.
Also, I thought someone made DBE installer that could install out outside
the shared "program files"?
modridirkac <jure.zorko@gmail.com> wrote:
>Copy to visual studio, framework 4.5, command line program.
>
>In paradox, just call it:
> execute(fullname(":tools:bde4gb_fill.exe")+" "+workingdir(),true)
>
>
>--------------------------------------------------------------------
>using System;
>using System.IO;
>
>namespace bde4gb_fill
>{
> class Program
> {
> static void Main(string[] args)
> {
> if (args.Length == 0)
> {
> System.Console.WriteLine("Please enter a valid path as
>first parameter");
> return;
> }
>
> string path = args[0];
> if (!Directory.Exists(path))
> {
> System.Console.WriteLine("Please enter a valid path.");
> return;
> }
>
>
> FileInfo file = new FileInfo(path);
> DriveInfo drive = new DriveInfo(file.Directory.Root.FullName);
> System.Console.WriteLine(drive.ToString());
>
> Decimal siz = drive.AvailableFreeSpace;
> System.Console.WriteLine("Available Free Space : " +
>siz.ToString() + "(bytes)");
>
> // how much over 4GB?
> Decimal over = siz;
> while (over > 4294967296)
> { over = over - 4294967296; }
> System.Console.WriteLine("Over 4GB:" +
>(over/1024/1024).ToString() + "(Mb)");
>
>
> string big_name = "big_file.txt";
> big_name = Path.Combine(path, big_name);
>
> if (over<536870912) // if lesss than 500Mb free
> { if (File.Exists(big_name))
> { // delete file
> File.Delete(big_name);
> System.Console.WriteLine("Big file name:" + big_name);
> System.Console.WriteLine("file deleted");
> }
> else
> { // create 600Mb file
> // but only if thee is really enough space
> if (siz > 536870912)
> using (var fileStream = new FileStream(@big_name,
>FileMode.Create, FileAccess.Write, FileShare.None))
> {
> fileStream.SetLength(6442450944);
> }
> System.Console.WriteLine("Big file name:" + big_name);
> System.Console.WriteLine("file created");
> }
> }
>#if DEBUG
> System.Console.ReadLine();
>#endif
>
>
> }
> }
>}
|