Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get file attributes including modify date and time

Former Member
0 Likes
1,587

Hi!

I couldn't found any function for reading files all attributes.

Size, owner, type, creation date and creation time is ok, but

modify date and creation time is missing.

Function EPS_GET_FILE_ATTRIBUTES is not enough.

LOOP AT dlist.

CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'

EXPORTING

file_name = dlist-name

dir_name = dpath

IMPORTING

file_size = fattr-file_size

file_owner = fattr-file_owner

file_mode = fattr-file_mode

file_type = fattr-file_type

file_mtime = fattr-file_mtime

EXCEPTIONS

read_directory_failed = 1

read_attributes_failed = 2

OTHERS = 3.

IF sy-subrc EQ 0.

fattr-file_name = dlist-name.

APPEND fattr.

ENDIF.

ENDLOOP.

SORT fattr BY file_name.

LOOP AT fattr.

point_in_time = fattr-file_mtime.

CALL FUNCTION 'POINT_IN_TIME_CONVERT'

EXPORTING

point_in_time = point_in_time

IMPORTING

date = mdate

time = mtime

EXCEPTIONS

OTHERS = 1.

SUBTRACT days1980 FROM mdate.

WRITE: / fattr-file_name,

fattr-file_size,

fattr-file_owner,

mdate,

mtime.

ENDLOOP.

Thank you your tips.

Viktor David

Hi!

I couldn't found any function for reading files all attributes.

Size, owner, type, creation date and creation time is ok, but

modify date and creation time is missing.

Function EPS_GET_FILE_ATTRIBUTES is not enough.

LOOP AT dlist.

CALL FUNCTION 'EPS_GET_FILE_ATTRIBUTES'

EXPORTING

file_name = dlist-name

dir_name = dpath

IMPORTING

file_size = fattr-file_size

file_owner = fattr-file_owner

file_mode = fattr-file_mode

file_type = fattr-file_type

file_mtime = fattr-file_mtime

EXCEPTIONS

read_directory_failed = 1

read_attributes_failed = 2

OTHERS = 3.

IF sy-subrc EQ 0.

fattr-file_name = dlist-name.

APPEND fattr.

ENDIF.

ENDLOOP.

SORT fattr BY file_name.

LOOP AT fattr.

point_in_time = fattr-file_mtime.

CALL FUNCTION 'POINT_IN_TIME_CONVERT'

EXPORTING

point_in_time = point_in_time

IMPORTING

date = mdate

time = mtime

EXCEPTIONS

OTHERS = 1.

SUBTRACT days1980 FROM mdate.

WRITE: / fattr-file_name,

fattr-file_size,

fattr-file_owner,

mdate,

mtime.

ENDLOOP.

Thank you your tips.

Viktor David

4 REPLIES 4
Read only

Former Member
0 Likes
1,056

Hi Victor,

Did you find any FM to get modified date for a file stored in the local drive?

I'm also looking for the same.

Thanks

Thruna Shanmuga

Read only

0 Likes
1,056

Hi Thruna!

No I've been fighting for these data's, but without any success. What do you think about to get file attributes from a cmd command (ex. ATTRIB), and export it by a function?

Viktor

Read only

0 Likes
1,056

Any other option in order to get the properties to a file longer than tdlist-name (char 40)???

Read only

Former Member
0 Likes
1,056

Hi

I believe the date and time you can get are the last modification

Max