C Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesC Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 5th, 2003, 05:08 PM
madhavan madhavan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 3 madhavan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
path Declaration in fopen(...

Hi!
Iam trying to write a program to update the copies of a file in different systems on a network. I am able to find the timestamp of the file in my current system using the fstat(...) function.
But,I do not know how to specify a path to another system in the network. I tried various ways in vain.

fh = fopen("C:\\GK\\C++\\file.txt","r");

The above declaration is working fine to locate the file in my system.

Suppose the path to the other file is
\\mil\GK\C++\Test\file.txt

where 'mil' is the name of the system. how should I declare it.

Also,is there any function to compare two time's and find the latest time.
Please let me know

Madhavan

Reply With Quote
  #2  
Old September 5th, 2003, 10:03 PM
Onslaught's Avatar
Onslaught Onslaught is offline
/(bb|[^b]{2})/
Dev Shed God (5000 - 5499 posts)
 
Join Date: Nov 2001
Location: Somewhere in the great unknown
Posts: 5,163 Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level)Onslaught User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 6 Days 1 h 34 m 20 sec
Reputation Power: 791
typically the other systems must be mapped drives, or at least the remote system must have shared rights to the folder that you are trying to access.
If you do with the system name instead of a mapped drive, remember that every backslash needs to be escaped.
i.e.
\\\\mil\\GK\\C++\\Test\\file.txt

As far as comparing two times, easiest way that comes to mind is to convert them into strings (if needed) and use strcmp and see what the result is.
strcmp() gives one of three values depending on how the comparison goes.
0 = the are equal
positive # = (can't remember right off hand) left is greater than right
negative # = right is greater that left

I would suggest you play around a bit and see, but there may also be a better method for this also.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesC Programming > path Declaration in fopen(...

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap