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

  • SEARCH
  • Home
  • 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 4029376
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:20:15+00:00 2026-05-20T11:20:15+00:00

I have the following code: Dir.chdir(mydir) Dir.entries(mydir).each do |file| log.info(file) end My problem is

  • 0

I have the following code:

Dir.chdir(mydir)
Dir.entries(mydir).each do |file|
  log.info(file)
end

My problem is that Dir.entries does not appear to “see” the three most recently created files in the directory; that is, they don’t show up in the log. I’m using Ruby 1.9.2 on Windows XP. The files were created immediately before the above code, via a StatTransfer command file:

# Run the stcmd file and wait for it to finish
threadC = Thread.new {system("ST \"myStatTransferProgram.stcmd\"")}
threadC.join

I don’t think that StatTransfer is the problem, because Dir.entries can “see” the first few files produced by the stcmd file just fine. I tried adding in sleep(30) between the two steps in case Thread.join doesn’t do what I think it does, but that didn’t make a difference. I am new to Ruby and would appreciate any suggestions– thank you!

  • 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-20T11:20:16+00:00Added an answer on May 20, 2026 at 11:20 am

    I’m not entirely sure what was going on, but it seems that the problem was related to a File.rename in an earlier step, not to the step I thought it was related to. I’m sorry for leading people down the wrong path. If anyone wants more info, just let me know.

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

Sidebar

Related Questions

I have to following code in ruby: <% files = Dir.glob('/**/*') files.each do |file|
I have the following code in a web.config file of the default IIS site.
I have following code that populates a System.Collections.Generic.List I don't like it so I
I have the following code I am trying to fix foreach (System.IO.DirectoryInfo dir in
i have the following code in batch (cmd): for /f delims= %%f in ('dir
I have the following code: fonts = dir('fonts') strcmp('BELL.TTF',fonts.name) where dir('fonts') returns a 33x1
I have the following Java code running in a media module: File file =
I have the following PHP code to display the file structure of my site.
Hello I have a problem with the following code in a GTMTestCase: - (void)testSomething
I Have following code: Controller: public ActionResult Step1() { return View(); } [AcceptVerbs(HttpVerbs.Post)] public

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.