Hi,
Is the name of the file is fixed? and the path of the file may vary from
time-to time? If yes, then you can use windows API function FindFirstFile()
to search for the path of your file. The declaration is:
Function ulong FindFirstFile (string lpFileName, ref WIN32_FIND_DATA
lpFindFileData) Library "KERNEL32.DLL" Alias for "FindFirstFileA"
And the structures:
global type WIN32_FIND_DATA from structure
unsignedlong fileattributes
filetime creationtime
filetime lastaccesstime
filetime lastwritetime
unsignedlong filesizehigh
unsignedlong filesizelow
unsignedlong reserved0
unsignedlong reserved1
character filename[260]
character alternatefilename[14]
end type
global type FILETIME from structure
ulong dwLowDateTime
ulong dwHighDateTime
end type
refer
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/findfirstfile.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/win32_find_data_str.asp
for more details.
Also other related functions :
Function boolean FindClose (ulong hFindFile) Library "KERNEL32.DLL"
Function boolean FindNextFile (ulong hFindFile, ref WIN32_FIND_DATA
lpFindFileData) Library "KERNEL32.DLL" Alias for "FindNextFileA"
Ofcourse, if your drive contains multiple files with the same name, you may
need the FindNextFile () function.
After you find the file, you can use FileCopy /FileMove function to move the
file to desired location.
Revert in case of further queries.
Regards,
Vikas
<Ari Bano> wrote in message news:41237a0b.395...@sybase.com...
Bruce Armstrong [TeamSybase]
http://www.teamsybase.com
TeamSybase blogs:
http://www.teamsybase.net/blogs
Vote for PocketBuilder in the Mobile Village awards
http://www.mobilevillage.com/awards.htm
Two 3rd party books on developing with PowerBuilder
http://www.pb9books.com?source=newsgroups
Need code sample? Check out CodeXchange:
http://www.codexchange.sybase.com
Preach the gospel at all times. If necessary, use words. - Francis of Assisi
http://www.needhim.org
---------------------------------------------------------------------
DISCLAIMER:
This newsgroup message is only intended for the recipient. Given that it
is a posting to a public newsgroup, that means if you can read this
message then you are the recipient. This message may contain information
that is confidential and protected from disclosure. And then again,
it may not.
Given that TeamSybase members are not employees of Sybase, the contents
of this message do not necessarily represent the views or policies of
Sybase. Given that TeamSybase is a diverse group of users of Sybase
products, the contents of this message do not necessarily represent the
views of a significant number of the members of TeamSybase. Given that the
author has multiple personalities and hears voices in his head, the contents
of this message do not necessarily represent his own views.