How do I delete a file? - file

I need to delete a picture from a folder where pictures are stored. For example, a file in the C:\Milk\Pictures folder. How do I do this?

Using the SysUtils function DeleteFile:
if DeleteFile(FileName) then
// File deleted;
SysUtils is usually included by default. In XE2, if you have to add it you may have to use System.SysUtils because of new namespace rules.

Related

Logic Apps SharePoint Connector - Move file with new file name

We have a integration requirement to move files from one folder to another in SharePoint Online. The new file name in the destination folder needs to be suffixed with the current datetime. For instance, if the source filename is Myfile.csv, it should be moved with the new name Myfile_2021-04-15T15:39:23.csv to the destination folder.
Using the Logic App SharePoint Move file action, I haven't been able to achieve this
If another file is already there is an enum and I'm unable to provide a custom expression for it. Further, with this option files are only renamed if there's a file with the same name already existing in the destination folder. Whereas our requirement is to attach datetime to all files that are being transferred, independent whether the file already exist in the destination folder or not.
How can I best achieve this?
Thanks in advance for any assistance.
Since the "Move file" action doesn't provide a feature for us to specify the new file name, I think the requirement can't be implemented by this action. You can just use other action to do it.
For example, use "Get file content" action to get the file content.
Then use "Create file" action to create the new file in the location which you want.
You can specify a name which you want in the "File name" input box.
By the way, the "Get file content" action doesn't provide an expression of file name for us to use in second step. But I noticed that you have got Full path in your description, so you can substring the Full path to get the original file name. And then use utcNow() method to get the current date and append it to file name.

How to update an existing .po file with a newly generated .pot file?

Cake version is 2.x. I have extracted all the texts inside __ function with ./Console/cake i18n extract command, moved the default.pot file into app/Locale/[iso3]/LC_MESSAGES/default.po and translated it to corresponding language. Everything is working fine.
After some time I have added some new functionality into the site and I need to add those messages into the po file. However if I use the same command it will create a new pot and I have to either manually merge them or replace with new po file and copy/paste the translations - both are too much manual work, because I have a few thousand lines of text.
Is there any way to tell cake update my po file adding only messages that does not exist in there ?
Thanks
Download PoEdit. It has an option to update your PO file from an existing pot file. From the menu go to Catalog -> Update from POT file.
So you will create your a new POT file and then update your PO file. PoEdit will update the PO file with the new values and I think it also removes any unnecessary ones.
PS: It would be wise before making any move to keep a backup.

Use Flags instead of links for language switching?

Is there a way to use flags instead of the language shortcodes for the language switcher links in ImpressPages 4?
Unfortunately I wasn't able to find any information on this and am not really clear where that code is generated in the php files...
many thanks
Michael
You need to override default view file that prints language selection. In this case it's Ip/Internal/Config/view/languages.php
To do that you need to create a corresponding file in your theme's override directory. The path to the file should be like this - Theme/YOUR_THEME_NAME/Ip/Internal/Config/view/languages.php
More about view file and how to override them - http://www.impresspages.org/docs/view
Just copy the original view file to a new location and make any changes you like. And you'll be safe with system updates.

Handling filetypes that contain multiple files?

Some filetypes in Visual Studio includes more then one file, for example resx and winform files. So If I need to add existing filetyp of this type I always end upp with multiple files in solution explorer? Are thay not supose to be shown as one file based on there name?
BestRegards
So If I need to add existing filetyp of this type I always end upp
with multiple files in solution explorer?
Multiple file is the part of ProjectItem template. If you add WinFor you will always get several files.
If you don't want to use such template you can create your own template from code created ones with File->Export Template wizard.
To group files in solution explorer read this post

How to Include file1 into another file in magento

I have 2 files in Catalog folder of my template. I want to include one file into another file I tried simple php "require('html2fpdf.php');" method but it does not works. Please let me know how can I include this file into other file.
In Magento you use getChildHtml to include blocks.
Magento work with layout and block concept.
So you need to create a block using some xml and block class file.Also you need to make sure your block is in proper layout handle.

Resources