Thread Subject: Get file date and time attributes from MATLAB...

Subject: Get file date and time attributes from MATLAB...

From: Andrey Kazak

Date: 12 Jun, 2009 09:35:02

Message: 1 of 11

Greetings!

Could you advice me please on the way to get file creation, modification date and time attributes from MATLAB?

Thanks in advance for prompt reply...

Subject: Get file date and time attributes from MATLAB...

From: John

Date: 12 Jun, 2009 16:44:02

Message: 2 of 11

You can get the last modified date and time using the dir command on a directory. Dont know about file creation time/date.

"Andrey Kazak" <AK@nospam.ru> wrote in message <h0t7g6$ic4$1@fred.mathworks.com>...
> Greetings!
>
> Could you advice me please on the way to get file creation, modification date and time attributes from MATLAB?
>
> Thanks in advance for prompt reply...

Subject: Get file date and time attributes from MATLAB...

From: Jan Simon

Date: 12 Jun, 2009 20:26:02

Message: 3 of 11

Dear Andrey Kazak!

> Could you advice me please on the way to get file creation, modification date and time attributes from MATLAB?

You can call "stat" from a MEX file. Did you found something in the FileExchange?

Good luck, Jan

Subject: Get file date and time attributes from MATLAB...

From: Jan Simon

Date: 12 Jun, 2009 21:07:02

Message: 4 of 11

Dear Andrey Kazak!

> Could you advice me please on the way to get file creation, modification date and time attributes from MATLAB?

I found "fileExist" in the FEX:
  import java.io.*;
  a=File(fileName);
  bool=a.exists();

You don't need the existience, but the modification date:
  a.lastModified()
I cannot help you with the format of the replied number... And the creation date cannot determined also. But at least a start...

Good luck, Jan

Subject: Get file date and time attributes from MATLAB...

From: Andrey Kazak

Date: 13 Jun, 2009 17:09:02

Message: 5 of 11

Hallo, Jan!

Could you explain to me please what FEX and MEX are?

Subject: Get file date and time attributes from MATLAB...

From: Jan Simon

Date: 16 Jun, 2009 13:20:16

Message: 6 of 11

Dear Andrey Kazak!

> Could you explain to me please what FEX and MEX are?
FEX means the "File Exchange" on the MathWorks home page:
  www.mathworks.com/matlabcentral/fileexchange/

MEX are compiled C/C++/Fortran files, which can be called from Matlab functions. "help mex" tells a short story about this.

Good luck, Jan

Subject: Get file date and time attributes from MATLAB...

From: Andrey Kazak

Date: 16 Jun, 2009 17:57:03

Message: 7 of 11

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <h1866g$ci2$1@fred.mathworks.com>...
> Dear Andrey Kazak!
>
> > Could you explain to me please what FEX and MEX are?
> FEX means the "File Exchange" on the MathWorks home page:
> www.mathworks.com/matlabcentral/fileexchange/
>
> MEX are compiled C/C++/Fortran files, which can be called from Matlab functions. "help mex" tells a short story about this.
>
> Good luck, Jan

OK, but what is FEX file?

Subject: Get file date and time attributes from MATLAB...

From: Jan Simon

Date: 16 Jun, 2009 23:14:02

Message: 8 of 11

Dear Andrey Kazak!

> > > Could you explain to me please what FEX and MEX are?
> > FEX means the "File Exchange" on the MathWorks home page:
> > www.mathworks.com/matlabcentral/fileexchange/
>
> OK, but what is FEX file?
It is a file (of any type), which can be downloaded from the FEX pages.

Good night, Jan

Subject: Get file date and time attributes from MATLAB...

From: Andrey Kazak

Date: 17 Jun, 2009 02:40:18

Message: 9 of 11

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <h198vq$kkq$1@fred.mathworks.com>...
> Dear Andrey Kazak!
>
> > > > Could you explain to me please what FEX and MEX are?
> > > FEX means the "File Exchange" on the MathWorks home page:
> > > www.mathworks.com/matlabcentral/fileexchange/
> >
> > OK, but what is FEX file?
> It is a file (of any type), which can be downloaded from the FEX pages.
>
> Good night, Jan

Does FEX states to File Exchange (http://www.mathworks.com/matlabcentral/fileexchange/)?

Subject: Get file date and time attributes from MATLAB...

From: Jan Simon

Date: 11 Jul, 2009 20:21:03

Message: 10 of 11

Dear Andrey Kazak!

> Could you advice me please on the way to get file creation, modification date and time attributes from MATLAB?

GetFileTime, SetFileTime at least for Windows:
http://www.mathworks.com/matlabcentral/fileexchange/24671

Kind regards, Jan

Subject: Get file date and time attributes from MATLAB...

From: Peter Knief

Date: 12 May, 2010 18:12:06

Message: 11 of 11

"Jan Simon" <matlab.THIS_YEAR@nMINUSsimon.de> wrote in message <h3as7f$mdp$1@fred.mathworks.com>...
> Dear Andrey Kazak!
>
> > Could you advice me please on the way to get file creation, modification date and time attributes from MATLAB?
>
> GetFileTime, SetFileTime at least for Windows:
> http://www.mathworks.com/matlabcentral/fileexchange/24671
>
> Kind regards, Jan
Dear Jan & Kazak

I stumbled today about this myself !

Perhaps already solved but for the date you could use :

files=dir(strcat(FullPathToFile,Filename));
last_modified=files.date;

Cheers
Peter

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
dir John 12 Jun, 2009 12:49:05
get file date t... Andrey Kazak 12 Jun, 2009 05:39:02
rssFeed for this Thread

Contact us at files@mathworks.com