file-management

Lock file in Xcode 4

六月ゝ 毕业季﹏ 提交于 2019-12-06 02:46:29
I've got a simple question. In Xcode 3 I was able to lock a file by clicking on the little lock icon at the top of each file. I'm missing this function in Xcode 4. I think I'm just blind. Can you help me? That feature was killed (partially) in Xcode 4. Even though you can Unlock a locked file from the File menu, you cannot Lock it. Even though locking files is still possible with the Finder, it is much more troublesome when you need to lock multiple files. The long way now involves right clicking the file in the Project Navigator and selecting Show In Finder. Using Get Info (Cmd-I) will allow

Rename all files in folder to uppercase with batch

隐身守侯 提交于 2019-12-05 12:00:46
Is there a way to rename all files in a specific folder to uppercase with batch file? I found this code. But it renames files to lowercase. How to modify it to rename to uppercase instead? for /f "Tokens=*" %f in ('dir /l/b/a-d') do (rename "%f" "%f") @echo off setlocal enableDelayedExpansion pushd c:\some_dir for %%f in (*) do ( set "filename=%%~f" for %%A in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do ( set "filename=!filename:%%A=%%A!" ) ren "%%f" "!filename!" >nul 2>&1 ) endlocal Samuel Champanhet This will put the extension to upper case as well.... Which was a problem for me

Change file owner in Windows

瘦欲@ 提交于 2019-12-04 05:52:20
Is there an API in Windows similar to Linux's chown ? aviv Taken from here: http://www.perlmonks.org/?node_id=70562 // #includes omitted for the sake of sanity HANDLE token; char *filename = "somefile.txt"; char *newuser = "someuser"; DWORD len; PSECURITY_DESCRIPTOR security = NULL; PSID sidPtr = NULL; int retValue = 1; // Get the privileges you need if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token)) { SetPrivilege(token, "SeTakeOwnershipPrivilege", 1); SetPrivilege(token, "SeSecurityPrivilege", 1); SetPrivilege(token, "SeBackupPrivilege", 1); SetPrivilege(token,

Best way to store/retrieve millions of files when their meta-data is in a SQL Database

不问归期 提交于 2019-12-04 03:14:52
I have a process that's going to initially generate 3-4 million PDF files, and continue at the rate of 80K/day. They'll be pretty small (50K) each, but what I'm worried about is how to manage the total mass of files I'm generating for easy lookup. Some details: I'll have some other steps to run once a file have been generated, and there will be a few servers participating, so I'll need to watch for files as they're generated. Once generated, the files will be available though a lookup process I've written. Essentially, I'll need to pull them based on an order number, which is unique per file.

Optimum web folder structure for ~250,000 images

妖精的绣舞 提交于 2019-12-03 13:55:53
问题 I will have around 200,000 images as part of my website. Each image will be stored 3 times: full size, thumbnail, larger thumbnail. Full size images are around 50Kb to 500Kb. Normal tech: Linux, Apache, MySQL, PHP on a VPS. What is the optimum way to store these for fast retrieval and display via a browser?? Should I store everything in a single folder? Should I store the full size images in 1 folder, the thumbails in another etc? Should I store the images in folders of 1000, and keep an

Optimum web folder structure for ~250,000 images

☆樱花仙子☆ 提交于 2019-12-03 03:52:00
I will have around 200,000 images as part of my website. Each image will be stored 3 times: full size, thumbnail, larger thumbnail. Full size images are around 50Kb to 500Kb. Normal tech: Linux, Apache, MySQL, PHP on a VPS. What is the optimum way to store these for fast retrieval and display via a browser?? Should I store everything in a single folder? Should I store the full size images in 1 folder, the thumbails in another etc? Should I store the images in folders of 1000, and keep an index to which folder the image is in? Thanks for any advice. Albert. I'd use a split directory structure,

How to download all files and folder hierarchy from Jupyter Notebook?

▼魔方 西西 提交于 2019-12-02 23:51:11
If I want to download all of the files and folder hierarchy from Jupyter Notebook as shown in the picture, do you know if there is anyway to do that by simple click other than go to every single file in every folder to open the file and click download hundreds of times? Note: This Jupyter Notebook is created by the online course teacher, so it's not opened from my local Acaconda app but the online course webpage instead. Downloading is for future memory refreshing whenever needed. Jason import os import tarfile def recursive_files(dir_name='.', ignore=None): for dir_name,subdirs,files in os

Properly move an object to the Trash

一个人想着一个人 提交于 2019-12-01 17:12:30
It looks like on Cocoa there are many ways to move file/folder-directory to Trash: [[[NSWorkspace sharedWorkspace] performFileOperation:NSWorkspaceRecycleOperation] [[NSWorkspace sharedWorkspace] recycleURLs:] [NSFileManager trashItemAtURL:] [NSFileManager removeItemAtPath:] [NSFileManager removeItemAtURL:] It would be nice to understand what the difference is by either reading an explanation here or a link to the official Apple docs. Also if someone knows a universal way of moving a file/non-empty directory to Trash, it would be nice to know. [[[NSWorkspace sharedWorkspace]

how to get the filename along with absolute path to the file, whenever a new file is created using inode in linux?

妖精的绣舞 提交于 2019-12-01 06:01:15
问题 I doing some experiments with my linux OS (CentOS) and I want to track all the tool logs created under the same environment, tool generates the respective logs (.log extn) for tracking these changes I wrote a perl watcher which actually monitoring the directory that I set and when the new file is created it will show at the output but This is consuming a lot of memory and CPU utilization as i have set 2sec as the sleep period. My QUESTION "Is there any better of way doing this ?" I thought of

Rename file in Cocoa?

北慕城南 提交于 2019-11-30 10:55:12
How would I rename a file, keeping the file in the same directory? I have a string containing a full path to a file, and a string containing a the new filename (and no path), for example: NSString *old_filepath = @"/Volumes/blah/myfilewithrubbishname.avi"; NSString *new_filename = @"My Correctly Named File.avi"; I know about NSFileManager's movePath:toPath:handler: method, but I cannot workout how to construct the new file's path.. Basically I'm looking for the equivalent to the following Python code: >>> import os >>> old_filepath = "/Volumes/blah/myfilewithrubbishname.avi" >>> new_filename =