PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Example of extracted path
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Returns the different elements of a path: disk, directories, name and extension of the file.
Reports and Queries
sFilePath is string
sResFileName is string
sResPathName is string

sFilePath = "C:\MyDirectories\File.doc"

// Retrieve the name of the file
sResFileName = fExtractPath(sFilePath, fFileName)
// sResFileName corresponds to "File"

// Retrieve the disk and path of the file
sResPathName = fExtractPath(sFilePath, fDrive + fDirectory)
// sResPathName corresponds to "C:\MyDirectories\"
Reports and Queries
// Use of UNC paths
Trace(fExtractPath("\\lg-br\sharedfiles\downloads\WINDEV\setup.exe", fDrive))
// Returns \\lg-br\sharedfiles
Trace(fExtractPath("\\lg-br\sharedfiles\downloads\WINDEV\setup.exe", fDirectory))
// Returns \downloads\WINDEV\
Syntax
<Result> = fExtractPath(<File path> , <Path section to extract>)
<Result>: Character string
  • Requested path section,
  • Empty string ("") if an error occurred. To find out the error details, use ErrorInfo associated with the errMessage constant.
<File path>: Character string (with quotes)
Name and full (or relative) path of file (up to 260 characters). A UNC path can be used. The existence of <File path> is not checked by fExtractPath. If the path does not end with a "\" character, the last element is considered as being a file.
Versions 15 and later
Windows This parameter can be in Ansi or Unicode format.
New in version 15
Windows This parameter can be in Ansi or Unicode format.
Windows This parameter can be in Ansi or Unicode format.
<Path section to extract>: Constant or combination of constants
Section of file path to extract:
fDriveName of the unit.
fExtensionExtension of the file, preceded by "."
fFileNameName of the file (without extension).
fDirectoryDifferent directories of the file (the file name and extension are not returned).
Remarks
Reports and Queries

Example of extracted path

If the specified path is "C:\Temp\Data\File.txt", fExtractPath returns:
  • fExtension: .txt
  • fFileName: File
  • fDirectory: \Temp\Data\
  • fDrive: C:
  • fFileName+fExtension: File.txt
  • fDirectory+fFileName: \Temp\Data\File
  • etc.
Component : wd250std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video FextractPath
https://youtu.be/pOujawO1cVo
https://windevdesenvolvimento.blogspot.com/2019/09/dicas-2291-windev-webdev-mobile.html
// BTN_ABRE_DOCUMENTO
extensao_arquivo is string=fExtractPath(TABLE_ARQUIVOS.COL_ARQUIVO,fExtension)
IF extensao_arquivo=".txt" THEN
ShellExecute(TABLE_ARQUIVOS.COL_ARQUIVO)
ELSE
OpenDocument(TABLE_ARQUIVOS.COL_ARQUIVO)
END
amarildo
15 Sep. 2019
EXEMPLO
https://youtu.be/KbKWNaL79Jw

http://windevdesenvolvimento.blogspot.com.br/2018/05/dicas-1744-publica-windev-arqivos-28.html

https://groups.google.com/d/forum/amarildowindev

// EXEMPLO

EDT_ARQUIVO=EDT_DIRETORIO+TABLE_LISTA_ARQUIVOS.COL_Nome

EDT_RESPOSTA="DIRETORIO:"+fExtractPath(EDT_ARQUIVO,fDirectory)+CR
EDT_RESPOSTA+="DRIVE:"+fExtractPath(EDT_ARQUIVO,fDrive)+CR
EDT_RESPOSTA+="NOME ARQUIVO:"+fExtractPath(EDT_ARQUIVO,fFileName)+CR
EDT_RESPOSTA+="EXTENSÃO:"+fExtractPath(EDT_ARQUIVO,fExtension)+CR

EDT_RESPOSTA+="NOME e extensão:"+fExtractPath(EDT_ARQUIVO,fFileName+fExtension)+CR
De matos
29 May 2018
AULA 1189 WinDev Arquivos 020 Separar Nome Arquivo
_descricao is string
_descricao = fExtractPath(EDT_arquivo_txt,fDirectory)
Info("DIRETORIO:"+_descricao)
_descricao = fExtractPath(EDT_arquivo_txt,fDrive)
Info("DRIVE"+_descricao)
_descricao = fExtractPath(EDT_arquivo_txt,fExtension)
Info("EXTENSÃO"+_descricao)
_descricao = fExtractPath(EDT_arquivo_txt,fFileName)
Info("NOME ARQUIVO"+_descricao)
_descricao = fExtractPath(EDT_arquivo_txt,fFileName+fExtension)
Info("NOME ARQUIVO E EXTENSÃO"+_descricao)

//BLOG COM VIDEO E EXEMPLO

http://windevdesenvolvimento.blogspot.com.br/2017/06/aula-1189-windev-arquivos-020-separar.html

https://www.youtube.com/watch?v=Qb2x1GZg_54

De matos
27 Jun. 2017
Exemplo Extrair Dados Arquivo
SAI_Arquivo=SAI_DIRETORIO+TABLE_lista_arquivos.COL_Nome_arquivo
sNomearquivo is string
sNomearquivo = fExtractPath(SAI_Arquivo,fDirectory)
SAI_resposta="fddire:"+sNomearquivo+CR
sNomearquivo = fExtractPath(SAI_Arquivo,fDrive)
SAI_resposta+="Drive:"+sNomearquivo+CR
sNomearquivo = fExtractPath(SAI_Arquivo,fExtension)
SAI_resposta+="extensao:"+sNomearquivo+CR
sNomearquivo = fExtractPath(SAI_Arquivo,fFileName)
SAI_resposta+="filenam:"+sNomearquivo+CR

//Blog com video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/03/curso-windev-arquivos-004-arquivos.html
De matos AMARILDO
16 Mar. 2016