directory

Android, folder deleted after some time

老子叫甜甜 提交于 2019-12-11 19:22:44
问题 My app is creating a folder and then an xml file on the sdcard. But after some time the folder is deleted and the file with it. The file is used to store a backup of the data from the app. I dont need something new to make backup but a description of why it happens. The folder is created in the root of the sdcard with the name 'backup'. This is how I create the folder and file: File path = new File(Environment.getExternalStorageDirectory() + "/backup/tet/"); path.mkdirs(); File backupdir =

Do I need to Allocate Memory for a Dirent Structure

。_饼干妹妹 提交于 2019-12-11 19:12:43
问题 Platform: Windows XP Service Pack 3 Compiler: Code::Blocks version 12.11 I am currently writing a program that will recursively delete a given directory using the POSIX directory functions. But I am having a problem with readdir() and its counterpart the dirent structure. I read in readdir's documentation that multiple calls to the function will overwrite the data held in the structure returned by the function. So I thought readdir() must allcoate memmory for the struct itself and then simply

Error making folders in Applescript

喜欢而已 提交于 2019-12-11 18:59:05
问题 So, i'm getting an error while running this: on hazelProcessFile(theFile) set text item delimiters to ":" set filename to last text item of (theFile as text) set text item delimiters to "." if filename contains "." then set base to text items 1 thru -2 of filename as text set extension to "." & text item -1 of filename else set base to filename set extension to "" end if set text item delimiters to {"720p", "HDTV", "x264", "IMMERSE", "-", "E01", "…", "E02", "EVOLVE"} set ti to text items of

VBA loop through directory

一曲冷凌霜 提交于 2019-12-11 18:55:54
问题 **Hi All, I would to incorporate into the below script the ability to search through files and export ONLY the data from the most recent file in folder. I will be adding a new file every week into folder so do not want the old data range to be copied across. Can someone please help?** Sub loopthroughdirectory() Dim myfile As String Dim erow fileroot = "C:\Users\ramandeepm\Desktop\consolidate\" myfilename = Dir("C:\Users\ramandeepm\Desktop\consolidate\") Do While Len(myfilename) > 7 If

Why is Powershell's Move-Item deleting the destination directory?

末鹿安然 提交于 2019-12-11 18:53:42
问题 I need to replace square brackets in filenames, and I've successfully created (and validated at the console) a -replace . Now I'm trying to Move-Item to a new directory because this bug in Powershell 2.0 prevents me from doing a simple file rename. Here's my script: $txtPath = "c:\users\xxxxxx\desktop\cgc\tx" #source files $txtPath2 = "c:\users\xxxxxx\desktop\cgc\tx2" #renamed files Get-ChildItem $txtPath | foreach { Move-Item -literalpath C:\users\xxxxxx\desktop\test001 ($_.Name -replace '\{

Copy Files to another folder PHP

て烟熏妆下的殇ゞ 提交于 2019-12-11 18:41:39
问题 So, recently I am working on a small social network, and I stuck at a beginner-fail :( When a new User is created, a new FOLDER - named like the User - is created in the current folder (/Users). In the current folder(/Users) is also a folder named PATTERN, where a index.php is included. When a new user is created with mkdir($Username, 0777) I also want to COPY the index.php from the PATTERN-Folder (/PATTERN) into the new User folder (/$Username). It just doesn't copy in my tries - how would

How do I delete the entire folder/ directory?

别来无恙 提交于 2019-12-11 18:40:07
问题 I want to delete the entire folder or directory along with files and folders contained in it. How can I implement in C#? 回答1: Try using Directory.Delete(dir_path, true); Check manual 回答2: Since it is tagges c# I assume the directory is at server side.Refer this link How to delete all files and folders in a directory? 回答3: var dInfo = new DirectoryInfo("your_path_to_dir"); dInfo.Delete(true); The true parameter in the Delete method is Recursive = true. This tells the method to delete the

Batch file to Write Filename to first line

痞子三分冷 提交于 2019-12-11 18:17:48
问题 Hello and first thank you for taking the time to read this. I am trying to write a simple batch file that will do one thing to every text file in a folder. The text file has the following format: Format of txt files: ##### [delimeter "tab"] ##### ##### [delimeter "tab"] ##### ##### [delimeter "tab"] ##### .... EOF I need to add one line as a header to each file in the folder. The header should consist of part of the filename. The filename will always have 2-3 letters and 3-5 numbers. I need

Powershell Remove-Item Cmdlet error

岁酱吖の 提交于 2019-12-11 18:12:10
问题 I'm using powershell to remove a directory with the command: Remove-Item $pathAsString -Recurse -Force However, it gives me the following error: Remove-Item : Cannot remove the item at 'C:\Path' because it is in use. At line:1 char:1 + Remove-Item "C:\Path" -Recurse + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Remove-Item], PSInvalidOperationException + FullyQualifiedErrorId : InvalidOperation,Microsoft.PowerShell

How to set an image in assets folder from Url in android

柔情痞子 提交于 2019-12-11 18:08:19
问题 I am planning to show some image in my app. Also, this images must be in assets folder. First I will upload images into assets folder from url, and when app runs, must show this images from assets folder. Is there any possible way to do this ? 回答1: The assets folder is read-only the images you get should be saved to a spot on the device then referenced by its path 回答2: there is a detailed explanation here for how to save image to internal directory and load them 来源: https://stackoverflow.com