Quantcast
Channel: Gik's notes » file
Browsing all 10 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Get work time of execution in BATCH

If you wish to see a time taked by some app execution, use next: @echo off setlocal set hours_before=%time:~0,2% set minutes_before=%time:~3,2% set seconds_before=%time:~6,2% REM Payload here: timeout...

View Article



Image may be NSFW.
Clik here to view.

Clear folder (subfolders and files) in BATCH

To delete all files and subfolders in given directory, you can use next snippet: @echo off setlocal enableextensions enabledelayedexpansion set pathDirToClear=C:\Tmp for /d %%A in (%pathDirToClear%)...

View Article

Image may be NSFW.
Clik here to view.

WordPress upload add another file extensions

Just add the following code to you functions.php in theme: add_filter('upload_mimes', 'custom_upload_mimes'); function custom_upload_mimes ( $existing_mimes=array() ) { // add $existing_mimes['xpi'] =...

View Article

Image may be NSFW.
Clik here to view.

Control Version System file structure proposals

Currently, i want to say a few words about CVS file structure. If you have a number of projects, probably deal with the problem of right files organization. In this case i mean projects are coupled...

View Article

Image may be NSFW.
Clik here to view.

Set file and folder permissions in Linux

Convenient way to apply permissions in Linux is to save alias in .bashrc file: Set all permissions for FTP: alias setftpperm="chown -R _pure-ftpd:_pure-ftpd /usr/serv/ftp/anonymous && \ chmod...

View Article


Image may be NSFW.
Clik here to view.

Using SETLOCAL and ERRORLEVEL together in Batch

Interesting thing about using SETLOCAL and ERRORLEVEL together. Consider two files: first.bat @echo off echo %ERRORLEVEL% in first bat before setlocal setlocal echo Some actions with error finished...

View Article

Image may be NSFW.
Clik here to view.

Unlock file in Windows with ProcessExplorer

It is often occurs locked files. How to unlock file from granted process? Very simple! Just use ProcessExplorer from Windows Sysinternals. Download here ProcessExplorer To perform unlocking, click...

View Article

Image may be NSFW.
Clik here to view.

Stream file download in a JSF managed bean

To output contents directly to browser in JSF 2.x use next method: public static void downloadFile(String fileName, String content, String contentType) throws IOException { FacesContext fc =...

View Article


Image may be NSFW.
Clik here to view.

Delete files and folders with long names in Windows

Using command line you can delete files and folders with long names: rmdir /S /Q <FOLDER_NAME_TO_DELETE>

View Article


Image may be NSFW.
Clik here to view.

Read and write files with stream in C#

Very basic example how to read and write files. The util class is as following: using System.IO; using System.Text; namespace Project.Dao { public class FileSystemUtils { public static string...

View Article
Browsing all 10 articles
Browse latest View live


Latest Images