Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Trouble reading modified date from network share  RSS feed

 
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: 2257
289
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • 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: 2257
289
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • 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.

 
expectation is the root of all heartache - shakespeare. tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!