Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6644983
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:13:53+00:00 2026-05-26T00:13:53+00:00

Is it possible to pause Mathematica kernel during a computation? Here is an example.

  • 0

Is it possible to pause Mathematica kernel during a computation? Here is an example.

Module[{},
       Mathematica code....
       ..........
       ..........
       {
        Calls an external program with some argument
        Needs to wait for an external program to create a file (* How ?*)
        }
       Mathematica code using that file content....
       ...........
       ...........
      ]

I can come up with a Do[..] loop solution that keeps on checking in a specified directory whether a file is created or not. Once it finds the file it reads the content and rest of the Mathematica code processes the data.

Is there any elegant way to solve this problem?

BR

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:13:53+00:00Added an answer on May 26, 2026 at 12:13 am

    Try Pause[n], pauses for at least n seconds.

    Edit: to make it work for an indeterminate amount of time, you need to repeatedly poll the filesystem. FileExistsQ does this, and you’d use it like

    While[!FileExistsQ[ "filename" ], Pause[1]]
    

    which would at most have one second of wasted time while waiting.

    Further Edit: You can also put the file existence poll in a batch file thereby freeing up your Mathematica session. E.g. make a batch file called C:\Temp\Test.bat containing:

    @echo off
    start /min apame_win64 input
    echo Loop commenced %TIME%
    :loop
    rem wait three seconds
    ping localhost -n 3 > nul
    if not exist c:\temp\alldone.txt goto loop
    rem wait while file is completely written out
    ping localhost -n 3 > nul
    rem then terminate the process
    taskkill /f /fi "imagename eq apame_win64.exe"
    exit
    

    And call it from Mathematica: Run["start /min c:\\temp\\test.bat"]

    This batch demo assumes apame_win64 will write out a file alldone.txt to complete.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have another issue on Simulink: Is it possible to pause a simulation during
Is it possible to pause a process, save the memory contents to a file,
I just wanna know if it is possible to pause a playing SWF file
In this code I want to Pause/Resume a thread using an AutoResetEvent and a
Possible Duplicate: javascript: pause setTimeout(); Im using jQuery and working on a notification system
Possible duplicate question: Is there a way to indefinitely pause a thread? In my
is it possible to configure the ANT to pause the building process untill a
Is it possible to have a php script pause at a certain point wait
Is it possible to do something like this in unix? monit restart | pause
Is it possible to display a trasparent .png using the pause command in the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.