logo
down
shadow

How do i run a .exe file with file creation?


How do i run a .exe file with file creation?

By : user2956959
Date : November 22 2020, 03:03 PM
hop of those help? your file is created in the current directory, that you can get its path by function: CurDir() you can change the current directory by calling SetCurrentDirectory function:
code :
Declare Function SetCurrentDirectory Lib "kernel32" Alias "SetCurrentDirectoryA" (ByVal lpPathName As String) As Long
Sub Button8_Click()
    MsgBox ("Old Dir = " & CurDir())
    SetCurrentDirectory ActiveWorkbook.path
    MsgBox ("Current Dir = " & CurDir())
    Dim path As String
    path = ActiveWorkbook.path

    path = path + "\Voltage Recording.exe"
    MsgBox (path)
    retval = Shell(path, vbNormalFocus)

End Sub


Share : facebook icon twitter icon
How do I delay creation of a text file until I actually write a line to it? (lazy creation)

How do I delay creation of a text file until I actually write a line to it? (lazy creation)


By : Anandkmr144
Date : March 29 2020, 07:55 AM
With these it helps I have a perl script that append text on a file : , Create a sub that does the opening for you.
code :
sub myappend {
    my ($fname, @args) = @_;
    open my $fh, '>>', $fname or die $!;
    print $fh @args;
    close $fh or die $!;
}

myappend($outfile, $line);
while ( ... ) {
    push @print, $line;
}

if (@print) {
    open my $fh, '>>', $outfile or die $!;
    print $fh @print;
}
while ( ... ) {
    push @{$print{$outfile}}, $line;
}

for my $key (%print) {
    open my $fh, '>>', $key or die $!;
    print $fh @{$print{$key}};
}
How to synchronize file creation in cache (not writing to a file, just creation)

How to synchronize file creation in cache (not writing to a file, just creation)


By : God Father
Date : March 29 2020, 07:55 AM
will help you May I suggest a couple of tweaks:
You are already using a ConcurrentHashMap, there is no need for an additional lock.
code :
class CachedFile
{
  File realFile;
  // Initially not cached
  boolean cached = false;

  // Construct with file

  public synchronized boolean isCached()
  { return cached; }

  public synchronized void cache()
  {
    if (!cached)
    {
      // now load - safe in the knowledge that no one can get the file (or cache())
      ..
      cached = true; // done
    }
  }

  public synchronized <File> getFile()
  {
    // return the "file"
  }
}
ConcurrentHashMap<String, CachedFile> myCache = ConcurrentHashMap<>();
CachedFile newFile = new CachedFile(<path>);
CachedFile file = myCache.putIfAbsent(<path>, newFile);
// Use the new file if it did not exist
if (file == null) file = newFile;
// This will be no-op if already cached, or will block is someone is caching this file.
file.cache();
// Now return the cached file.
return file.getFile();
PoCo Logging. Log file name containing timestamp of creation OR New log file every time application starts

PoCo Logging. Log file name containing timestamp of creation OR New log file every time application starts


By : user2872743
Date : March 29 2020, 07:55 AM
I hope this helps you . FileChannel has rotateOnOpen property. If you set this to true, it will create new file every time channel is opened. See FileChannel. If you do not have this property available, you are using an older version of Poco; in this case, you can simply open File channel with a newly generated name every time your application starts:
code :
std::string name = yourCustomNameGenFunc(); 
AutoPtr<FileChannel> pChannel = new FileChannel(name);
Multiple File Creation In C++ Using File Handling Specific To A Particular Function Call

Multiple File Creation In C++ Using File Handling Specific To A Particular Function Call


By : Conor Dungan
Date : March 29 2020, 07:55 AM
it fixes the issue You'll need static variables.
A static variable lets you have presistent data between function calls.
code :
std::string createFileName()
{
    static int x = 0;
    std::string filename = "file_";
    filename += x;
    filename += ".txt";
    x++;
    return filename;
}
Get file creation date for filename for each file rather than for 1 file only?

Get file creation date for filename for each file rather than for 1 file only?


By : user2473825
Date : March 29 2020, 07:55 AM
With these it helps I currently have the setup below. Want I want it to do is to to scan 3 directories, display all files (up to 12) in each for each directory. In the filename name column I want it to display the file creation date for each file. However, it's only looping over the creation date for either 1 file or the index.php file rather than looking in the directories folder? Can anyone assist please? , Replace the whole foreach loop with this.
code :
for ($i = 1; $i <= 12; $i++) {
    if (file_exists($items[$i])) {
        echo "</tr>";
        echo "<td><font face='Arial' size='3'>$i</font></td>";
        echo "<td><font face='Arial' size='3' color='red'>" . date("F d Y H:i", filemtime($items[$i]));
        echo "</font></td>";
    }
    print("

           <td><img src='$dirs[0]/$cam1[$i]' height='80' width='80'></td>
           <td><img src='$dirs[1]/$cam2[$i]' height='80' width='80'></td>
           <td><img src='$dirs[2]/$cam3[$i]' height='80' width='80'></td>

   ");
   if ($i === 12) break; //unnecessary should/could be removed
 }
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org