Search Results

Search found 4355 results on 175 pages for 'filesystem notification'.

Page 35/175 | < Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >

  • Delete Range of Data From Text File With PHP

    - by Evan Byrne
    I want to delete a range of data from a text file using PHP. Let's assume the file contains the following: Hello, World! I want to delete everything from character 2 to character 7. The actual file I need to do this with is very large, so I don't want to have to read the large file in order to delete just a small, given range of data. The data contained within the given range is not known, so str_replace or preg_replace solutions wouldn't work anyways. Thanks!

    Read the article

  • SQLITE Blob OR file system for images

    - by saint cyr
    Hello, I am building an application based on a single table with a column with text. Occassionally, an adjacent column will have an image. Is it better to store this image as a BLOB in SQLITE or should I store them on the file system and reference them from my programs. Thanks!

    Read the article

  • Implementing Qt File Dialog with a Different File System Library (boost)

    - by knight
    Hi, I am writing an application which requires me to use another file system and file engine handlers and not the qt's default ones. Basically what I want to be able to do is to use qt's file dialog but have an underlying file system handler (for example built using boost file system library) of mine handling all the operations with regards to file and directory operations within that dialog. I have already written a custom file engine which handles some of the operations but I am now stuck with Qt's file system model and the file system watcher engine, as I need to have the signals transmitted for this custom file engine. Seems like I have a daunting task ahead. Am I heading in the right direction? Is there any other simpler way that I could implement this? Can anyone give me any idea on how to proceed. I was thinking of looking into proxy models but not sure if that would work. Thanks in advance for any help.

    Read the article

  • Unable to open a file for writing

    - by asdasdas
    I am trying to write to a file. I do a file_exists check on it before I do fopen and it returns true (the file does exist). However, the file fails this code and gives me the error every time: $handle = fopen($filename, 'w'); if($handle) { flock($handle, LOCK_EX); fwrite($handle, $contents); } else { echo 'ERROR: Unable to open the file for writing.',PHP_EOL; exit(); } flock($handle, LOCK_UN); fclose($handle); Is there a way I can get more specific error details as to why this file does not let me open it for writing? I know that the filename is legit, but for some reason it just wont let me write to it. I do have write permissions, I was able to write and write over another file.

    Read the article

  • How do I copy security information when creating a new folder?

    - by dhh
    In my app I'm creating folders for archiving old stuff from a harddisc. When creating a new folder I must copy all NTFS rights (Groups / Users) from the source folder to the newly created destination folder. Here is what I've written so far: FileSecurity fileSecurity = File.GetAccessControl(filenameSource, AccessControlSections.All); FileAttributes fileAttributes = File.GetAttributes(filenameSource); File.SetAccessControl(filenameDest, fileSecurity); File.SetAttributes(filenameDest, fileAttributes); Is this really all I ought to do or am I missing something important?

    Read the article

  • iPhone Mobile Safari File System Access

    - by Jon Smallberries
    Is it possible to write to a file in a native iPhone application and have a Safari browser read from that file after having the browser opened from the native app? Alternatively (and this would be great!), would it be possible to launch a mobile Safari webapp from a native iPhone app, and have that application access the OS 3.0 External Accessory Framework? My assumption is no... Basically, I have a functioning iPhone app that wraps a simple mobile Safari webapp, but I'd like to utilize the external accessory framework once I have launched the Safari webapp from the iPhone app...

    Read the article

  • Is it possible to capture a "file not found" from another process and then return a file to that pro

    - by Neil N
    I have a legacy application that looks for files in a directory. It does not handle missing files very well. What I want to do is "capture" the file not found errors, and send another file back to the calling app instead. Similar to how you could handle a 404 error on a webserver and return something based on what the requested URL was, except on the local file system. Is this possible? And more preferably, is it possible in .Net?

    Read the article

  • Browser application & local file system access

    - by Beyond HTML
    I want to enhance my browser-based web application with functionality that enables management of local files and folders. E.g. folder tree structures should be synchronized between local workstation and server via HTTP(S). I am aware of security-related limitations in browser-based applications. However, there are some techniques that "work around" these issues: Signed Java applets (full trust) .NET Windows Forms browser controls (no joke, that works. Just the configuration is horrible) ActiveX My question is: What do you use/suggest, both technology and implementation practice? Key requirement is that the installation process is as simple as possible. Thanks for your opinions!

    Read the article

  • Determining filetype of file in assets folder

    - by ChaimKut
    Question: How do you programmatically distinguish between directories and regular files in the assets folder? When using AssetManager to access files in the assets folder, it seems impossible to determine if a file is in fact a file or a directory. You get the list of files from the list method and then open the file using the open method. I thought perhaps using the openFd method to get the asset file descriptor (and then subsequently requesting the normal file descriptor) would provide me some information. But requesting the file descriptor for a directory results in an IOException (which makes sense since what would it mean for a directory to have a file descriptor...?). Currently I'm relying on that IOException (resulting from attemptng to open a directory in the assets folder) in order to determine if a file is in fact a directory. (Opening a regular file works just fine). This seems like a bad idea. Any other suggestions to distinguish between a file and a directory?

    Read the article

  • Clickonce Online Only Uninstall

    - by Aaron Bush
    Is there an established way to uninstall an application that was deployed via ClickOnce using the Online Only method? I found it's location buried deep in the %APPDATA% tree, but I want to make sure I back it out all the way without creating future problems when I reinstall it.

    Read the article

  • How to determine who changed a file?

    - by Cocowalla
    In Windows, how can I programmatically determine which user account last changed or deleted a file? I know that setting up object access auditing may be an option, but if I use that I then have the problem of trying to match up event log entries to specific files... sounds messy! I can't think of any other way, so does anyone either have any tips for this approach or any alternatives?

    Read the article

  • Python: problem with tiny script to delete files

    - by Rosarch
    I have a project that used to be under SVN, but now I'm moving it to Mercurial, so I want to clear out all the .svn files. It's a little too big to do it by hand, so I decided to write a python script to do it. But it isn't working. def cleandir(dir_path): print "Cleaning %s\n" % dir_path toDelete = [] files = os.listdir(dir_path) for filedir in files: print "considering %s" % filedir # continue if filedir == '.' or filedir == '..': print "skipping %s" % filedir continue path = dir_path + os.sep + filedir if os.path.isdir(path): cleandir(path) else: print "not dir: %s" % path if 'svn' in filedir: toDelete.append(path) print "Files to be deleted:" for candidate in toDelete: print candidate print "Delete all? [y|n]" choice = raw_input() if choice == 'y': for filedir in toDelete: if os.path.isdir(filedir): os.rmdir(filedir) else: os.unlink(filedir) exit() if __name__ == "__main__": cleandir(dir) The print statements show that it's only "considering" the filedirs whose names start with ".". However, if I uncomment the continue statement, all the filedirs are "considered". Why is this? Or is there some other utility that already exists to recursively de-SVN-ify a directory tree?

    Read the article

  • C# move file as soon as it becomes available.

    - by m0s
    Hi, I need to accomplish the following task: Attempt to move a file. If file is locked schedule for moving as soon as it becomes available. I am using File.Move which is sufficient for my program. Now the problems are that: 1) I can't find a good way to check if the file I need to move is locked. I am catching System.IO.IOException but reading other posts around I discovered that the same exception may be thrown for different reasons as well. 2) Determining when the file gets unlocked. One way of doing this is probably using a timer/thread and checking the scheduled files lets say every 30 seconds and attempting to move them. But I hope there is a better way using FileSystemWatcher. This is a .net 3.5 winforms application. Any comments/suggestions are appreciated. Thanks for attention.

    Read the article

  • Windows 7 Missing Shortnames

    - by Aaron Bush
    I noticed that if you get a Scripting.File object from certain windows files (Example: any wav in C:\Windows\Media) the Scripting.File.ShortPath property shows the long path. Curious I dropped to the command prompt and tried Dir /A /X and sure enough the short paths were missing from all the files in that directory. Anyone know: A.) What that's all about? B.) How to get the short path of a file that doesn't seem to have one?

    Read the article

  • Python script to delete old SVN files lacks permission

    - by Rosarch
    I'm trying to delete old SVN files from directory tree. shutil.rmtree and os.unlink raise WindowsErrors, because the script doesn't have permissions to delete them. How can I get around that? Here is the script: # Delete all files of a certain type from a direcotry import os import shutil dir = "c:\\" verbosity = 0; def printCleanMsg(dir_path): if verbosity: print "Cleaning %s\n" % dir_path def cleandir(dir_path): printCleanMsg(dir_path) toDelete = [] dirwalk = os.walk(dir_path) for root, dirs, files in dirwalk: printCleanMsg(root) toDelete.extend([root + os.sep + dir for dir in dirs if '.svn' == dir]) toDelete.extend([root + os.sep + file for file in files if 'svn' in file]) print "Items to be deleted:" for candidate in toDelete: print candidate print "Delete all %d items? [y|n]" % len(toDelete) choice = raw_input() if choice == 'y': deleted = 0 for filedir in toDelete: if os.path.exists(filedir): # could have been deleted already by rmtree try: if os.path.isdir(filedir): shutil.rmtree(filedir) else: os.unlink(filedir) deleted += 1 except WindowsError: print "WindowsError: Couldn't delete '%s'" % filedir print "\nDeleted %d/%d files." % (deleted, len(toDelete)) exit() if __name__ == "__main__": cleandir(dir) Not a single file is able to be deleted. What am I doing wrong?

    Read the article

  • Program visible to Linux as normal directory

    - by Xam
    I'm trying to write program to work as programmable directory, in other words: User, or other systems open that directory and read/write files or dirs. I try to create program to cache most used files in memory (less I/O to HDD), but right now I don't know how to achive that. There are probably some docs about this but I can't find them. I know that there is FUSE, NFS and others, but reading their source is quite difficult. If any one has info about implementation in C lang I'll be very grateful. Sorry for my English..

    Read the article

  • Writing photos (and other things) to disk and getting them later in iphone

    - by ebabchick
    I'm trying to write an image to disk: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsPath = [paths objectAtIndex:0]; NSString* savePath = [documentsPath stringByAppendingPathComponent:@"photo"]; BOOL result = [data writeToFile:savePath atomically:YES]; if(result) NSLog(@"Save of photo success!"); Then, later, I try to retrieve for a table view cell image: NSData* getPhoto = [NSData dataWithContentsOfFile:[leaf content]]; UIImage* myImage = [UIImage imageWithData:getPhoto]; cell.imageView.image = myImage; Yes, I checked to make sure the [leaf content] returns the same NSString as savePath. What else could be the problem? [NSData dataWithContentsOfFile:[leaf content]]; returns nil.... Thanks guys

    Read the article

  • What is the universal way to use file I/O API with unicode filenames?

    - by dma_k
    In Windows there is a common problem: the filenames should be converted to local codepage, before they are passed to open(). Of course, there is a possibility to use Win32::API for that, but I don't want my script to be platform-dependent. At the moment I have to write something like: open IN, "<", encode("cp1251", $filename) or die $!; but is there any library, that hides these details? I think the local codepage can be automatically detected, so I just want to pass unicode filename and forget about the details. Why is it still not in the box?

    Read the article

< Previous Page | 31 32 33 34 35 36 37 38 39 40 41 42  | Next Page >