This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Trouble reading modified date from network share

 
Ranch Hand
Posts: 35
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I resolved the problem I had with reading and writing JSON files from a network share, but then I ran into a problem with reading the modified date of a network shared file.
I researched the required code and came up with the following but the file date always ends up 0.
Here is the actual output on the console:
smb://nsp.local/pi/sprinkler/status.json pi 0

Can someone help me understand what is wrong?

 
Saloon Keeper
Posts: 2658
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesn't answer your Mac-specific question, but if I run your code on a Windows platform, the date does get reported properly.
 
Ron McLeod
Saloon Keeper
Posts: 2658
333
Android Eclipse IDE Angular Framework MySQL Database TypeScript Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works on Mac 10.11.6 as well
 
Mike Gauthier
Ranch Hand
Posts: 35
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got this working.  I had been working on the schedule.json file for 7-8 days and when I started working on the status file I used status.json.  Problem is, the file name is actually status.txt!

I changed it and all is well now.

I thought everything was okay because there was no error being thrown. Guess that's normal for file not found with the modified date call.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!