473,597 Members | 2,157 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to retrieve Last modified Date of a ftp directory

2 New Member
Is there any way I can retrieve Last modified Date of a ftp directory. i tried
$date_string = ftp->mdtm($director yname)

But i get the error "File not found"
May 17 '10 #1
3 6741
Gurydian
2 New Member
You probably need to prefix the directory with "..\\" or possibly fully qualify the directory name from the root. Alternatively, you may need to further escape the prefix text depending on your OS. It looked like a DOS-like message, so I used that syntax.

The message you received as the error is exactly the behavior of being in the directory and issuing a DIR MYDIR command, where MYDIR is the name of your directory.

Other possible solutions include:
$datetime=ftp->mdtm(".");
$datetime=ftp->mdtm("../$directory");
$datetime=ftp->mdtm("..\\$dir ectory");

Sometimes you will run into a situation where a period (.) needs to be escaped, but that is in regular expressions. So if you need to build a variable using regular expressions then it may be required to escape those special characters so they will function as literals.

You may also need to explicitly set your directory with a CD command (ftp->cd) if you are using relative directory names.

Gurydian
May 18 '10 #2
diptiperlforum
2 New Member
It worked.
Thanks :)
May 20 '10 #3
prashantsaraogi
1 New Member
Thanks it helps me out also..

FTP->mtdm($file) function works for absolute path only.

$file should be complete path from root onward.

if we set root path dir1/dir2

and acutal file is inside of dir1/dir2/dir3/dir4/file...

then path of file should be /dir3/dir4/file ...
Dec 3 '14 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
19013
by: Rich Pasco | last post by:
The PERL statement I use to open a text file looks like this: open(HANDLE, $filename); Now how can I get the "last modified" date of that file? I need a solution that works the same under Windows or Unix. - Rich
11
3623
by: Dennis Marks | last post by:
There seems to be a major program with the automatic display of the last modified date. Using the javascript "document.lastModified" sometimes returns the correct date and sometimes 1 Jan 1970 depending the the browser. Using SSI LAST_MODIFIED can return the last modified date, ISP system boot date, or many others. The only last modified date that I have been able to use with any consistancy is the SSI flastmod command.
5
4243
by: Boniface Frederic | last post by:
Hi, Is it possible to know the last modified date of a text file in javascript. Any help would be appreciated. Thanks. Fred.
4
2652
by: IdleBrain | last post by:
Hello All, Is it possible to obtain the last Modified date for the source code from within the application? If yes, please let me know how it is done.
1
2376
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format Last Modified date with javascript ----------------------------------------------------------------------- Apparently, « new Date() » reads it correctly, though problems can occur if the browser returns only two digits for the year. In particular, time zone, field order and separators may vary. It is also reliant on the server's clock...
1
1815
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format the Last-Modified date with javascript? ----------------------------------------------------------------------- Apparently, ` new Date() ` reads it correctly, though problems can occur if the browser returns only two digits for the year. In particular, time zone, field order and separators may vary. It is also reliant on the server's...
7
8527
by: mariyana | last post by:
How can we get the last accessed date and the last modified date of a file using VB6
1
2479
by: sudkum | last post by:
Hi, i am just trying to get the last modified date/time of a trx file trough batch file is this possible. I need this to use in copy statement like, i just wanted to copy newly modified/created file to another location. Please give me the solution
0
7965
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7885
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8031
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6686
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5426
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3881
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2399
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.